/*  v3.0.0 mobile surface — Direction 1 Editorial Calm
    Loaded by index.html alongside the existing styles. Only the .m-app
    tree uses these classes, so desktop is untouched.

    Typography: Fraunces (serif display + numerals), Manrope (body),
    JetBrains Mono (labels / timestamps).
    Theme: pure OLED black dark, warm cream paper light. */

/* ── Scroll model: BODY is the scroll surface ──────────────────────
   Previously .m-page-wrap had overflow-y:auto which made it a nested
   scroll container — iOS killed momentum and bounce inside nested
   scrollers on WKWebView. With body as the scroller, iOS applies its
   native momentum + rubber-band on the actual document, which is what
   users expect ('natural scrolling'). Horizontal scroll is still
   locked via overflow-x:hidden + overscroll-behavior-x:none.

   SCOPED with :has(.m-app) — previously this used a bare `html, body`
   selector which leaked the OLED-black background, momentum scrolling,
   and overflow-x:hidden onto the desktop dashboard. The desktop now
   draws the warm editorial bg (#14130f / #fbf9f3) as intended; the
   mobile shell adds .m-app to the DOM so these rules only fire there. */
html:has(.m-app),
body:has(.m-app) {
  margin: 0;
  /* Hard-min the viewport height so the body never ends before the
     bottom of the screen — that's what was leaving a white safe-area
     stripe at the home-indicator. Both 100% and 100dvh guarantee the
     painted background extends to the bottom edge under iOS Capacitor. */
  min-height: 100%;
  min-height: 100dvh;
  background: #000;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  overscroll-behavior-y: auto; /* allow native iOS rubber-band */
  -webkit-overflow-scrolling: touch;
}
body:has(.m-app) { /* only when the mobile shell is mounted */
  touch-action: pan-y;
}
/* When the mobile shell is in LIGHT theme, paint html + body cream so
   the iOS safe-area at top + bottom matches the page. Previously html
   stayed black and a white stripe appeared at the home-indicator. */
body:has(.m-light) { background: #faf8f3; }
html:has(.m-light) { background: #faf8f3; }

.m-app {
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-top: env(safe-area-inset-top);
  padding-bottom: 0;
  position: relative;
}
.m-dark  { background: #000; color: #f3f1ec; }
.m-light { background: #faf8f3; color: #1a1a1a; }

/* Page content area — NOT a scroll container. Just padding + gap.
   The bottom padding makes room for the fixed tab bar. */
.m-page-wrap {
  flex: 1;
  padding: 6px 18px calc(96px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Tab bar (fixed, safe-area aware) ─────────────────────────────── */
.m-tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(64px + env(safe-area-inset-bottom));
  padding: 6px 8px calc(env(safe-area-inset-bottom) + 4px);
  background: inherit;
  z-index: 50;
}
.m-dark  .m-tabbar { background: linear-gradient(to top, #000 70%, #000d 100%); border-top: 1px solid #ffffff0d; }
.m-light .m-tabbar { background: linear-gradient(to top, #faf8f3 70%, #faf8f3d0 100%); border-top: 1px solid #1a1a1a0d; }
.m-tab {
  background: none; border: none; color: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.5;
  padding: 4px 2px 2px;
  cursor: pointer;
  position: relative;
}
.m-tab svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.m-tab.on { opacity: 1; }
.m-tab.on::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%; transform: translateX(-50%);
  width: 18px; height: 1.5px;
  background: currentColor;
}

/* ── Page header (editorial) ─────────────────────────────────────── */
.m-pagehd {
  padding: 14px 2px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.m-crumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
}
.m-title {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 6px 0 0;
}
.m-sub {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.35;
  opacity: 0.65;
  margin-top: 4px;
}

/* ── Hero card variants ──────────────────────────────────────────── */
.m-hero {
  border-radius: 24px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.m-dark  .m-hero { background: linear-gradient(160deg, #1b0e2e 0%, #0c0518 100%); border: 1px solid #ffffff0f; }
.m-light .m-hero { background: linear-gradient(160deg, #ede5f7 0%, #faf3ff 100%); border: 1px solid #1a1a1a0a; }
.m-hero-go  { background: linear-gradient(160deg, #2a1056 0%, #4a1c8a 100%) !important; color: #fbeede; border-color: #ffffff14 !important; }
.m-light .m-hero-go { background: linear-gradient(160deg, #ede5f7 0%, #d9c8ff 100%) !important; color: #1a1a1a; }

.m-heyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
  display: flex; align-items: center; gap: 8px;
}
.m-heyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #a3eeff;
  box-shadow: 0 0 8px #a3eeff;
}
.m-heyebrow-done::before { background: #71d893; box-shadow: 0 0 8px #71d893; }
.m-heyebrow-on::before { background: #ffd28a; box-shadow: 0 0 8px #ffd28a; animation: m-pulse 1.4s infinite; }
@keyframes m-pulse { 0%, 100% { opacity: 1 } 50% { opacity: 0.4 } }

.m-htime {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 52px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}
.m-htime small {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0;
  margin-left: 6px;
  opacity: 0.6;
}
.m-htime-small {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-style: italic;
  font-size: 32px;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 4px;
  opacity: 0.85;
}
.m-hstate {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.2;
  margin-top: 6px;
  opacity: 0.9;
}
.m-hstate em { opacity: 0.7; }
.m-hrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid currentColor;
  border-top-color: rgba(255,255,255,.10);
}
.m-light .m-hrow { border-top-color: rgba(26,26,26,.12); }
.m-hlbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
}
.m-hbtn {
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 500;
  background: #a3eeff;
  color: #1a1a1a;
  cursor: pointer;
}
.m-light .m-hbtn { background: #7c3aed; color: #fff; }
.m-hbtn-off { background: #ff9b9b; color: #4a0e0e; }
.m-light .m-hbtn-off { background: #b13838; color: #fff; }
.m-hbtn:disabled { opacity: 0.5; }
.m-hcta {
  margin-top: 14px;
  padding: 18px 18px;
  border-radius: 16px;
  border: none;
  background: #7c3aed;
  color: #fff;
  text-align: center;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 20px;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 24px -8px #7c3aedaa;
  cursor: pointer;
  width: 100%;
}
.m-light .m-hero-go .m-hcta { background: #2a1a36; color: #fbeede; box-shadow: 0 10px 24px -8px #2a1a3666; }
.m-hcta:disabled { opacity: 0.5; }

/* ── Skeleton (loading) ──────────────────────────────────────────── */
.m-skel {
  border-radius: 16px;
  background: linear-gradient(90deg, transparent 0%, #ffffff08 50%, transparent 100%) #0a0a0a;
  background-size: 200% 100%;
  animation: m-shimmer 1.4s linear infinite;
  height: 80px;
}
.m-light .m-skel { background-color: #1a1a1a08; }
@keyframes m-shimmer { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
.m-hero-load { padding: 0; min-height: 200px; }
.m-skel-list { display: flex; flex-direction: column; gap: 8px; }

/* ── Empty state ─────────────────────────────────────────────────── */
.m-empty {
  padding: 36px 18px;
  text-align: center;
}
.m-empty-t {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}
.m-empty-s {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  opacity: 0.6;
}

/* ── Generic card ────────────────────────────────────────────────── */
.m-card {
  border-radius: 18px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.m-dark  .m-card { background: #0c0c0c; border: 1px solid #ffffff0a; }
.m-light .m-card { background: #fff; border: 1px solid #1a1a1a0a; }
.m-ctop { display: flex; justify-content: space-between; align-items: baseline; }
.m-clbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
}
.m-cval {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 30px;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.m-cval em {
  font-style: italic;
  font-size: 15px;
  opacity: 0.55;
  margin-left: 3px;
}
.m-prog {
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}
.m-dark  .m-prog { background: #ffffff10; }
.m-light .m-prog { background: #1a1a1a0d; }
.m-prog-bar {
  height: 100%;
  background: linear-gradient(to right, #7c3aed, #a3eeff);
  border-radius: 3px;
  transition: width 400ms ease;
}
.m-card-big {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
}
.m-card-big em { font-style: italic; opacity: 0.75; }
.m-card-sub {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  opacity: 0.65;
}

/* ── Quote / note ────────────────────────────────────────────────── */
.m-note {
  border-radius: 14px;
  padding: 14px 16px;
  font-family: 'Fraunces', serif;
  font-size: 14px;
  font-style: italic;
  line-height: 1.45;
  font-weight: 300;
}
.m-dark  .m-note { background: #0a0a0a; color: #f3f1ec; border-left: 2px solid #7c3aed; }
.m-light .m-note { background: #f3eef9; color: #2c1856; border-left: 2px solid #7c3aed; }
.m-note-who {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 6px;
}

/* ── Segmented control (PTO/Tickets) ─────────────────────────────── */
.m-seg2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
}
.m-dark  .m-seg2 { background: #0c0c0c; border: 1px solid #ffffff0a; }
.m-light .m-seg2 { background: #f3eef9; border: 1px solid #1a1a1a0a; }
.m-seg {
  border: none; padding: 9px 12px;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-family: inherit; font-size: inherit; font-weight: inherit;
  opacity: 0.55;
  cursor: pointer;
}
.m-dark  .m-seg.on { background: #f3f1ec; color: #050505; opacity: 1; }
.m-light .m-seg.on { background: #fff; color: #1a1a1a; opacity: 1; box-shadow: 0 1px 3px #1a1a1a14; }

/* ── PTO request card ─────────────────────────────────────────────── */
.m-reqcard {
  border-radius: 16px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
}
.m-dark  .m-reqcard { background: #0c0c0c; border: 1px solid #ffffff08; }
.m-light .m-reqcard { background: #fff; border: 1px solid #1a1a1a08; }
.m-rwhen {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.m-rwhen em { font-style: italic; opacity: 0.6; font-weight: 300; }
.m-rwhy {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  opacity: 0.6;
  grid-column: 1 / 2;
}

/* ── Pills ────────────────────────────────────────────────────────── */
.m-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid;
  align-self: start;
  margin-top: 2px;
  white-space: nowrap;
}
.m-pill.ok { color: #2c7a47; border-color: #2c7a4744; background: #2c7a4716; }
.m-pill.pn { color: #b07320; border-color: #b0732044; background: #b0732016; }
.m-pill.no { color: #b13838; border-color: #b1383844; background: #b1383816; }
.m-dark .m-pill.ok { color: #92e7a8; background: #92e7a812; border-color: #92e7a833; }
.m-dark .m-pill.pn { color: #ffd28a; background: #ffd28a12; border-color: #ffd28a33; }
.m-dark .m-pill.no { color: #ff9b9b; background: #ff9b9b12; border-color: #ff9b9b33; }

/* ── Ticket card ─────────────────────────────────────────────────── */
.m-ticket {
  border-radius: 14px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.m-dark  .m-ticket { background: #0c0c0c; border: 1px solid #ffffff08; }
.m-light .m-ticket { background: #fff; border: 1px solid #1a1a1a0a; }
.m-ticket-dim { opacity: 0.7; }
.m-ttop { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.m-ttitle {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.m-tcode {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  opacity: 0.5;
  letter-spacing: 0.08em;
}
.m-tmeta {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  opacity: 0.65;
  display: flex; gap: 8px; align-items: center;
}
.m-sep { opacity: 0.45; }
.m-section-hd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.5;
  margin: 12px 4px 0;
}

/* ── FAB ─────────────────────────────────────────────────────────── */
.m-fab {
  position: fixed;
  bottom: calc(86px + env(safe-area-inset-bottom));
  right: 18px;
  width: 56px; height: 56px;
  border-radius: 28px;
  border: none;
  background: #7c3aed;
  color: #fff;
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 26px;
  box-shadow: 0 14px 32px -8px #7c3aedaa;
  cursor: pointer;
  z-index: 30;
  /* iOS WKWebView: stop double-tap-to-zoom + long-press magnifier. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.m-fab > * { pointer-events: none; }

/* ── On-call ────────────────────────────────────────────────────── */
.m-now {
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(140deg, #4d1a9e 0%, #1b0a3a 100%);
  color: #f3f1ec;
  position: relative;
  overflow: hidden;
  border: 1px solid #ffffff14;
}
.m-light .m-now { background: linear-gradient(140deg, #4d1a9e 0%, #7c3aed 100%); }
.m-now::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, #a3eeff44 0%, transparent 60%);
}
.m-now-eb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.75;
  display: flex; align-items: center; gap: 8px;
}
.m-now-eb::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #a3eeff;
  box-shadow: 0 0 10px #a3eeff;
  animation: m-pulse 1.6s infinite;
}
.m-now-name {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
}
.m-now-name em { font-style: italic; opacity: 0.8; }
.m-now-meta { font-family: 'Manrope'; font-size: 12px; opacity: 0.78; }
.m-avs { display: flex; margin-top: 4px; }
.m-av {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid #1b0a3a;
  margin-left: -8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces'; font-style: italic; font-size: 12px; color: #1a1a1a;
}
.m-light .m-av { border-color: #4d1a9e; }
.m-av:first-child { margin-left: 0; }

.m-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
}
.m-dark  .m-week { background: #0c0c0c; border: 1px solid #ffffff0a; }
.m-light .m-week { background: #fff; border: 1px solid #1a1a1a0a; }
.m-day {
  text-align: center;
  padding: 8px 0;
  border-radius: 8px;
}
.m-day-l {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
  line-height: 1.5;
}
.m-day-n {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.15;
}
.m-day.today {
  background: #7c3aed18;
  border: 1px solid #7c3aed44;
}
.m-day.today .m-day-n { color: #7c3aed; font-style: italic; font-weight: 500; }
.m-dark .m-day.today { background: #7c3aed28; }

/* ── Profile ──────────────────────────────────────────────────────── */
.m-profhd {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 12px 16px;
}
.m-pav {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 42px;
  color: #fff;
  letter-spacing: -0.02em;
  box-shadow: 0 14px 32px -8px #7c3aed55;
}
.m-pname {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}
.m-prole {
  font-family: 'Manrope';
  font-size: 12px;
  opacity: 0.65;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}
.m-list {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
}
.m-dark  .m-list { background: #0c0c0c; border: 1px solid #ffffff0a; }
.m-light .m-list { background: #fff; border: 1px solid #1a1a1a0a; }
.m-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 14px 16px;
}
.m-dark  .m-row + .m-row { border-top: 1px solid #ffffff08; }
.m-light .m-row + .m-row { border-top: 1px solid #1a1a1a08; }
.m-row-l {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 500;
}
.m-row-r {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  opacity: 0.6;
}
.m-mono { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.m-toggle {
  width: 40px; height: 24px;
  border-radius: 12px;
  position: relative;
  background: #7c3aed;
  cursor: pointer;
}
.m-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 18px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px #00000033;
  transition: left 160ms ease;
}
.m-toggle.off { background: #00000022; }
.m-dark .m-toggle.off { background: #ffffff20; }
.m-toggle.off::after { left: 2px; }
.m-theme-seg {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  font-family: 'Manrope';
  font-size: 11px;
  font-weight: 500;
}
.m-dark  .m-theme-seg { background: #ffffff10; }
.m-light .m-theme-seg { background: #1a1a1a0a; }
.m-theme-seg button {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0.6;
}
.m-dark  .m-theme-seg button.on { background: #f3f1ec; color: #1a1a1a; opacity: 1; }
.m-light .m-theme-seg button.on { background: #1a1a1a; color: #faf8f3; opacity: 1; }

.m-signout {
  margin-top: 14px;
  padding: 16px;
  text-align: center;
  border-radius: 14px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  color: #b13838;
  border: 1px solid #b1383844;
  background: transparent;
  cursor: pointer;
}
.m-dark .m-signout { color: #ff9b9b; border-color: #ff9b9b33; background: #ff9b9b08; }
.m-light .m-signout { background: #fff; }

/* ── Bottom sheets ────────────────────────────────────────────────── */
.m-sheet-back {
  position: fixed;
  inset: 0;
  background: #0008;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  animation: m-fade 180ms ease;
  /* Kill the WKWebView double-tap-zoom misfire that left the page
     stuck enlarged when the user tried to dismiss the sheet (v3.5.4). */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.m-sheet, .m-sheet * {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.m-sheet textarea { touch-action: manipulation; font-size: 16px; }
@keyframes m-fade { from { opacity: 0 } to { opacity: 1 } }
.m-sheet {
  width: 100%;
  border-radius: 28px 28px 0 0;
  padding: 14px 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 88vh;
  overflow-y: auto;
  animation: m-up 240ms cubic-bezier(.2,.8,.2,1);
}
.m-dark  .m-sheet { background: #0c0518; color: #f3f1ec; border-top: 1px solid #ffffff10; }
.m-light .m-sheet { background: #faf8f3; color: #1a1a1a; }
@keyframes m-up { from { transform: translateY(40px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
.m-sheet-grab {
  width: 38px; height: 4px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.25;
  margin: 0 auto 4px;
}
.m-sheet-title {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 30px;
  letter-spacing: -0.025em;
  line-height: 1;
}
.m-sheet-title em { font-style: italic; opacity: 0.7; }
.m-sheet-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-top: 6px;
}
.m-chips {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.m-chip {
  font-family: 'Manrope';
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-transform: lowercase;
}
.m-dark  .m-chip { border-color: #ffffff20; }
.m-light .m-chip { border-color: #1a1a1a18; background: #fff; }
.m-chip.on { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.m-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-datebox {
  border-radius: 14px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.m-dark  .m-datebox { background: #ffffff0c; border: 1px solid #ffffff16; }
.m-light .m-datebox { background: #fff; border: 1px solid #1a1a1a14; }
.m-datebox span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
}
.m-datebox input {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
  letter-spacing: -0.02em;
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  padding: 0;
}
.m-textarea, .m-input {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.4;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid;
  background: transparent;
  color: inherit;
  outline: none;
  resize: vertical;
}
.m-dark  .m-textarea, .m-dark  .m-input { border-color: #ffffff16; background: #ffffff08; }
.m-light .m-textarea, .m-light .m-input { border-color: #1a1a1a14; background: #fff; }
.m-cta {
  margin-top: 8px;
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: #7c3aed;
  color: #fff;
  text-align: center;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 24px -8px #7c3aedaa;
  cursor: pointer;
}
.m-cta:disabled { opacity: 0.5; }

.m-err {
  padding: 10px 14px;
  border-radius: 12px;
  background: #b1383815;
  color: #ff9b9b;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
}
.m-light .m-err { color: #b13838; }

/* ── v3.0.2 extras ─────────────────────────────────────────────────── */
.m-banner {
  border-radius: 12px;
  padding: 10px 14px;
  font-family: 'Manrope', sans-serif;
  font-size: 12.5px;
  line-height: 1.4;
}
.m-banner strong { font-weight: 600; }
.m-banner-warn {
  background: #b073201a; color: #b07320;
  border: 1px solid #b0732033;
}
.m-dark .m-banner-warn { background: #ffd28a14; color: #ffd28a; border-color: #ffd28a33; }

.m-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.m-ms {
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}
.m-dark  .m-ms { background: #0c0c0c; border: 1px solid #ffffff0a; }
.m-light .m-ms { background: #fff; border: 1px solid #1a1a1a0a; }
.m-ms-v {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.m-ms-l {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-top: 4px;
}

.m-activity {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.m-arow {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: baseline;
  gap: 10px;
}
.m-ats {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  opacity: 0.55;
}
.m-atxt {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  line-height: 1.3;
}

.m-shift-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.m-shift {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px 10px;
  align-items: baseline;
  padding: 8px 0;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
}
.m-shift + .m-shift {
  border-top: 1px solid currentColor;
  border-top-color: rgba(255,255,255,.06);
}
.m-light .m-shift + .m-shift { border-top-color: rgba(26,26,26,.06); }
.m-shift-name { font-weight: 500; }
.m-shift-when { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; opacity: 0.55; letter-spacing: 0.04em; }
.m-shift-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
}
.m-shift.mine {
  background: linear-gradient(90deg, #7c3aed14 0%, transparent 100%);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 0 -6px;
}
.m-shift.mine .m-shift-name { color: #7c3aed; font-style: italic; }
.m-dark .m-shift.mine .m-shift-name { color: #c084fc; }

/* Pill class aliases (m-pill-ok already exists via .m-pill.ok above) */
.m-pill-ok { color: #2c7a47; border-color: #2c7a4744; background: #2c7a4716; }
.m-pill-pn { color: #b07320; border-color: #b0732044; background: #b0732016; }
.m-pill-no { color: #b13838; border-color: #b1383844; background: #b1383816; }
.m-dark .m-pill-ok { color: #92e7a8; background: #92e7a812; border-color: #92e7a833; }
.m-dark .m-pill-pn { color: #ffd28a; background: #ffd28a12; border-color: #ffd28a33; }
.m-dark .m-pill-no { color: #ff9b9b; background: #ff9b9b12; border-color: #ff9b9b33; }
.m-pill-ok, .m-pill-pn, .m-pill-no {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid;
  align-self: start;
  white-space: nowrap;
}

/* ── v3.0.3 mobile login ─────────────────────────────────────────── */
.m-login {
  /* Cover the FULL viewport regardless of body height. Previously the
     min-height: 100dvh approach could leave a white safe-area stripe at
     the bottom on some iOS WKWebView builds. position: fixed + inset:0
     guarantees the purple radial gradient extends edge to edge. */
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) 22px calc(env(safe-area-inset-bottom) + 22px);
  background:
    radial-gradient(120% 70% at 70% 10%, #2a0a55 0%, transparent 60%),
    radial-gradient(120% 80% at 0% 100%, #4d1a9e 0%, transparent 60%),
    #050008;
  color: #fbeede;
  font-family: 'Manrope', -apple-system, sans-serif;
  overflow-y: auto;
}
.m-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(2px 2px at 20% 30%, #ffffff20 50%, transparent 100%) 0 0 / 240px 240px,
    radial-gradient(1.5px 1.5px at 60% 70%, #ffffff15 50%, transparent 100%) 0 0 / 180px 180px;
  opacity: 0.4;
  pointer-events: none;
}
.m-login-frame {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1;
}
.m-login-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: 0 24px 60px -12px #5b21b6cc, 0 0 0 1px #ffffff10 inset;
}
.m-login-logo img {
  width: 100%; height: 100%; display: block; object-fit: cover;
}
.m-login-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-top: 4px;
}
.m-login-title {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-top: 4px;
}
.m-login-title em { font-style: italic; }
.m-login-sub {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  opacity: 0.7;
  line-height: 1.4;
  margin-top: 10px;
  margin-bottom: 26px;
}
.m-login-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 4px;
}
.m-login-input {
  width: 100%;
  background: #ffffff0a;
  border: 1px solid #ffffff18;
  border-radius: 14px;
  padding: 14px 16px;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: inherit;
  outline: none;
  margin-bottom: 14px;
  -webkit-appearance: none;
  appearance: none;
}
.m-login-input:focus {
  border-color: #a3eeff66;
  background: #ffffff10;
}
.m-login-code {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-size: 26px;
  letter-spacing: 0.4em;
  padding-left: 16px;
  padding-right: 16px;
}
.m-login-cta {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: -0.01em;
  box-shadow: 0 16px 36px -10px #7c3aedaa;
  cursor: pointer;
}
.m-login-cta:disabled { opacity: 0.4; }
.m-login-back {
  background: none;
  border: none;
  color: inherit;
  margin-top: 14px;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  opacity: 0.6;
  padding: 8px;
  cursor: pointer;
}
.m-login-foot {
  margin-top: 14px;
  font-family: 'Manrope', sans-serif;
  font-size: 11.5px;
  opacity: 0.55;
  letter-spacing: 0.01em;
  text-align: center;
}

/* ── v3.0.4: editable profile rows ────────────────────────────────── */
.m-row-tap {
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  width: 100%;
  font: inherit;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 14px 16px;
  -webkit-tap-highlight-color: transparent;
}
.m-row-tap:active {
  background: #7c3aed12;
}
.m-row-tap + .m-row-tap,
.m-row + .m-row-tap,
.m-row-tap + .m-row {
  border-top: 1px solid #ffffff08;
}
.m-light .m-row-tap + .m-row-tap,
.m-light .m-row + .m-row-tap,
.m-light .m-row-tap + .m-row {
  border-top-color: #1a1a1a08;
}

/* ── v3.0.5: strike banner tap target + strike sheet ─────────────── */
.m-banner-tap {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  cursor: pointer;
  background: inherit;
  color: inherit;
  font: inherit;
}
.m-banner-tap:hover, .m-banner-tap:active {
  filter: brightness(1.08);
}

.m-strike-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.m-strike-row {
  border-radius: 12px;
  padding: 12px 14px;
  background: #b1383815;
  border: 1px solid #b1383830;
}
.m-dark .m-strike-row { background: #ff9b9b10; border-color: #ff9b9b22; }
.m-strike-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.m-strike-when {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.7;
}
.m-strike-body {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.85;
}

/* ── v3.0.10 notifications inbox ──────────────────────────────────── */
.m-notif-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}
.m-notif-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  align-items: start;
  width: 100%;
  border: none;
  background: none;
  color: inherit;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.m-dark  .m-notif-row { background: #0c0c0c; border: 1px solid #ffffff0a; }
.m-light .m-notif-row { background: #fff;    border: 1px solid #1a1a1a0a; }
.m-notif-row:active   { filter: brightness(1.08); }
.m-notif-row.read     { opacity: 0.6; }
.m-notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #7c3aed;
  box-shadow: 0 0 6px #7c3aed99;
  margin-top: 6px;
}
.m-notif-row.read .m-notif-dot {
  background: transparent;
  box-shadow: none;
  border: 1px solid currentColor;
  opacity: 0.35;
}
.m-notif-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.m-notif-top {
  display: flex; justify-content: space-between; gap: 8px;
  align-items: baseline;
}
.m-notif-kind {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.55;
}
.m-notif-when {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  opacity: 0.5;
}
.m-notif-title {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.m-notif-sub {
  font-family: 'Manrope', sans-serif;
  font-size: 11.5px;
  line-height: 1.4;
  opacity: 0.7;
}

/* ── v3.1.0 onboarding tour ──────────────────────────────────────── */
.m-onboard {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) 24px calc(env(safe-area-inset-bottom) + 24px);
  background:
    radial-gradient(120% 70% at 70% 10%, #2a0a55 0%, transparent 60%),
    radial-gradient(120% 80% at 0% 100%, #4d1a9e 0%, transparent 60%),
    #050008;
  color: #fbeede;
  font-family: 'Manrope', -apple-system, sans-serif;
  z-index: 10000;
}
.m-onboard-frame {
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
.m-onboard-progress {
  display: flex; gap: 6px;
  margin: 0 auto 18px;
}
.m-onboard-dot {
  width: 22px; height: 3px; border-radius: 2px;
  background: #ffffff20;
  transition: background 200ms;
}
.m-onboard-dot.on { background: #a3eeff; }

.m-onboard-logo {
  width: 88px; height: 88px;
  border-radius: 22px;
  overflow: hidden;
  margin: 0 auto 4px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 20px 50px -12px #5b21b6cc, inset 0 0 0 1px #ffffff10;
  background: #5b21b6;
}
.m-onboard-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.m-onboard-tabicon {
  width: 64px; height: 64px;
  margin: 0 auto 6px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  color: #a3eeff;
  background: #ffffff08;
  border: 1px solid #ffffff14;
}
.m-onboard-tabicon svg { width: 30px; height: 30px; }

.m-onboard-hi {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 2px;
}
.m-onboard-tabname {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-top: 2px;
}
.m-onboard-title {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.025em;
  text-align: center;
  margin: 8px 0 6px;
}
.m-onboard-title em { font-style: italic; }
.m-onboard-body {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.45;
  text-align: center;
  opacity: 0.78;
  margin: 0 6px;
}
.m-onboard-body strong { font-style: normal; font-weight: 600; opacity: 1; }

.m-onboard-nav {
  display: flex; flex-direction: column;
  gap: 8px;
  margin-top: 28px;
}
.m-onboard-cta {
  padding: 16px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: -0.01em;
  box-shadow: 0 16px 36px -10px #7c3aedaa;
  cursor: pointer;
}
.m-onboard-skip {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  padding: 10px;
  cursor: pointer;
}
.m-onboard-back {
  align-self: flex-start;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.55;
  font-family: 'Manrope', sans-serif;
  font-size: 12.5px;
  padding: 4px 0;
  cursor: pointer;
}

/* ── v3.2.0 Ask AI chat sheet + pull-to-refresh spin ─────────────── */
@keyframes m-spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }

.m-askai-sheet {
  max-height: 80vh;
  display: flex; flex-direction: column;
}
.m-askai-chat {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 0;
  min-height: 200px;
  max-height: 50vh;
}
.m-askai-row {
  padding: 12px 14px;
  border-radius: 16px;
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 88%;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.m-askai-bot {
  align-self: flex-start;
  background: #ffffff10;
  border-top-left-radius: 4px;
}
.m-light .m-askai-bot { background: #1a1a1a0a; }
.m-askai-you {
  align-self: flex-end;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  border-top-right-radius: 4px;
}
.m-askai-typing {
  opacity: 0.5;
  font-style: italic;
  font-family: 'Fraunces', serif;
}

/* ── v3.3.0 iPad: centre the editorial column on bigger screens ──── */
/* The mobile-first design works best as a narrow reading column. On
   iPad the WebView is 768pt+ wide; without these rules the cards
   stretch corner-to-corner and lose intimacy. Solution: cap the
   content column at 540px and centre it, same for the bottom tab
   bar. Background stays full-bleed so safe areas still match the
   theme. */
@media (min-width: 700px) {
  .m-page-wrap {
    max-width: 600px;
    margin: 0 auto;
    padding-left: 28px;
    padding-right: 28px;
  }
  .m-tabbar {
    max-width: 600px;
    margin: 0 auto;
    left: 0; right: 0;
    border-radius: 32px 32px 0 0;
  }
  /* Login + onboarding stay centred at a slightly wider card */
  .m-login-frame { max-width: 480px; }
  .m-onboard-frame { max-width: 480px; }
  /* Hero card looks lonely full-width on iPad — give it a softer cap */
  .m-hero { max-width: 600px; margin-left: auto; margin-right: auto; }
  /* Sheets: cap their grow on iPad so they don't span the whole screen */
  .m-sheet { max-width: 600px; margin: 0 auto; }
  /* FAB stays right-aligned to the centred column, not the whole screen */
  .m-fab,
  .m-askai-fab {
    right: max(18px, calc(50% - 300px + 18px));
  }
}
@media (min-width: 1024px) {
  /* iPad Pro 12.9 — open up a bit more breathing room without going
     full desktop. Keep the editorial column character. */
  .m-page-wrap { max-width: 680px; padding-left: 36px; padding-right: 36px; }
  .m-tabbar    { max-width: 680px; }
  .m-hero      { max-width: 680px; }
  .m-sheet     { max-width: 680px; }
  .m-fab,
  .m-askai-fab {
    right: max(18px, calc(50% - 340px + 18px));
  }
}

/* ── v3.4.0 office/home hint inside the Sign-in hero ─────────────── */
.m-loc-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 2px;
}
.m-loc-hint em {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0;
  opacity: 1;
  font-size: 13px;
  margin-left: 2px;
}

/* ── v3.6.0 hero secondary row: I'm stuck + History ──────────────── */
.m-stuck-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid currentColor;
  border-top-color: color-mix(in oklab, currentColor 12%, transparent);
}
.m-stuck {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in oklab, #ff9b9b 35%, transparent);
  background: color-mix(in oklab, #ff9b9b 8%, transparent);
  color: #ff9b9b;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  transition: background 160ms ease, transform 120ms ease;
}
.m-stuck:active { transform: scale(0.98); }
.m-stuck:disabled { opacity: 0.5; cursor: default; }
.m-stuck-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #ff9b9b;
  color: #1a0000;
  font-weight: 800;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.m-hist {
  background: none;
  border: none;
  padding: 11px 6px;
  min-height: 44px;
  color: currentColor;
  opacity: 0.65;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.m-hist:hover { opacity: 1; }

/* ── v3.6.0 HistorySheet rows ───────────────────────────────────── */
.m-sheet-tall { max-height: 92vh; }
.m-hist-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0 8px;
}
.m-hist-row {
  padding: 12px 0 14px;
  border-bottom: 1px solid color-mix(in oklab, currentColor 8%, transparent);
}
.m-hist-row:last-child { border-bottom: none; }
.m-hist-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.m-hist-date {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: -0.015em;
}
.m-hist-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  opacity: 0.75;
}
.m-hist-line {
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  margin-top: 4px;
  color: currentColor;
  opacity: 0.92;
}
.m-hist-lbl {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-right: 8px;
  min-width: 38px;
}
.m-hist-blocker { color: #ff9b9b; }
.m-hist-blocker .m-hist-lbl { color: #ff9b9b; opacity: 0.85; }

/* ============================================================
   v3.6.0 iPad adaptive layout
   Phone < 900 px  → editorial column (already shipped above)
   Tablet 900–1200 → two-column dashboard (hero + activity rail)
   Desktop > 1200  → wider dashboard with bigger gutters
   ============================================================ */
@media (min-width: 900px) and (max-width: 1199px) {
  .m-page-wrap {
    max-width: 1080px;
    padding-left: 40px;
    padding-right: 40px;
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(360px, 1fr);
    column-gap: 36px;
    align-items: start;
  }
  /* Page header still spans the full width */
  .m-page-wrap > .m-page-hd { grid-column: 1 / -1; }
  /* The hero anchors the left column */
  .m-hero { max-width: none; grid-column: 1 / 2; }
  /* Cards on the right column stack as the activity rail */
  .m-card { grid-column: 2 / 3; }
  /* Other widgets flow into either column */
  .m-banner, .m-banner-warn { grid-column: 1 / -1; }
  .m-tabbar {
    max-width: 1080px;
    margin: 0 auto;
    border-radius: 32px 32px 0 0;
  }
  .m-sheet { max-width: 760px; }
  .m-fab, .m-askai-fab {
    right: max(18px, calc(50% - 540px + 18px));
  }
}

@media (min-width: 1200px) {
  /* Full dashboard mode — three implicit zones via two columns + spans */
  .m-page-wrap {
    max-width: 1280px;
    padding-left: 56px;
    padding-right: 56px;
    display: grid;
    grid-template-columns: minmax(520px, 1.2fr) minmax(420px, 1fr);
    column-gap: 56px;
    align-items: start;
  }
  .m-page-wrap > .m-page-hd { grid-column: 1 / -1; }
  .m-hero  { max-width: none; grid-column: 1 / 2; }
  .m-card  { grid-column: 2 / 3; }
  .m-banner, .m-banner-warn { grid-column: 1 / -1; }
  .m-tabbar {
    max-width: 1280px;
    margin: 0 auto;
    border-radius: 32px 32px 0 0;
  }
  .m-sheet { max-width: 880px; }
  .m-fab, .m-askai-fab {
    right: max(18px, calc(50% - 640px + 18px));
  }
}

/* ── v3.8.x Phase-1 employee features ───────────────────────────── */
/* One-tap "out today" (Sick / PTO) under the sign-in CTA */
.m-out-row {
  display: flex; gap: 10px; margin-top: 12px;
}
.m-out-btn {
  flex: 1; min-height: 44px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, currentColor 16%, transparent);
  background: color-mix(in oklab, currentColor 5%, transparent);
  color: currentColor;
  font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 160ms ease, transform 120ms ease;
}
.m-out-btn:active { transform: scale(0.98); }
.m-out-btn:disabled { opacity: 0.5; }

/* Success notice (sick/pto confirmation) */
.m-notice {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in oklab, #71d893 14%, transparent);
  border: 1px solid color-mix(in oklab, #71d893 34%, transparent);
  color: #8fe0ab;
  font-family: 'Manrope', sans-serif; font-size: 13px; line-height: 1.4;
}

/* Streak + month-attendance stat line on the This-week card */
.m-statline {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid color-mix(in oklab, currentColor 8%, transparent);
}
.m-stat {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'Manrope', sans-serif; font-size: 12.5px; font-weight: 600;
  opacity: 0.9;
}
.m-stat-ic { font-size: 13px; }

/* ── v3.8.x Phase-2 employee features ───────────────────────────── */
.m-card-tap { transition: transform 120ms ease; }
.m-card-tap:active { transform: scale(0.99); }

/* Weekly recap sheet body */
.m-recap-body {
  overflow-y: auto; padding: 4px 0 8px;
  font-family: 'Manrope', sans-serif; font-size: 14px; line-height: 1.55;
}
.m-recap-h { font-family: 'Fraunces', serif; font-style: italic; font-size: 17px; margin: 10px 0 4px; }
.m-recap-li { padding-left: 4px; opacity: 0.92; margin: 2px 0; }
.m-recap-p { opacity: 0.9; margin: 4px 0; }

/* Reply-to-bot in the notifications inbox */
.m-reply-link {
  background: none; border: none; cursor: pointer;
  color: var(--m-accent, #a98bff);
  font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 600;
  padding: 4px 0; touch-action: manipulation;
}
.m-reply-send {
  min-height: 44px; padding: 0 14px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #7c3aed, #5b21b6); color: #fff;
  font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; touch-action: manipulation;
}
.m-reply-send:disabled { opacity: 0.5; }

/* Ticket inline actions */
.m-tactions { display: flex; gap: 8px; margin-top: 10px; }
.m-tbtn {
  flex: 1; min-height: 40px; border-radius: 10px;
  border: 1px solid color-mix(in oklab, currentColor 18%, transparent);
  background: color-mix(in oklab, currentColor 5%, transparent);
  color: currentColor;
  font-family: 'Manrope', sans-serif; font-size: 12.5px; font-weight: 600;
  cursor: pointer; touch-action: manipulation;
}
.m-tbtn-ok {
  border-color: color-mix(in oklab, #71d893 40%, transparent);
  background: color-mix(in oklab, #71d893 12%, transparent);
  color: #8fe0ab;
}
.m-tbtn:disabled { opacity: 0.5; }

/* Profile tappable row */
.m-row-tap { transition: background 140ms ease; }
.m-row-tap:active { background: color-mix(in oklab, currentColor 6%, transparent); }

/* ── v3.8.x Phase-3 polish ──────────────────────────────────────── */
/* Tappable avatar with camera affordance */
.m-avatar-edit .m-avatar-cam {
  position: absolute; right: -2px; bottom: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  box-shadow: 0 4px 12px -4px #000a, 0 0 0 2px var(--m-bg, #000);
}
.m-avatar-edit:active { transform: scale(0.97); }

/* Accessibility: visible keyboard/focus ring + respect reduced motion */
.m-app :focus-visible {
  outline: 2px solid #a98bff;
  outline-offset: 2px;
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  .m-app *, .m-app *::before, .m-app *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
/* Honor the OS text-size setting where the WebView allows it */
.m-app { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* ── v3.10.0 sign-in quick-fill chips ───────────────────────────── */
.m-qchips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 4px 0 10px;
}
.m-qchip {
  border: 1px solid color-mix(in oklab, currentColor 16%, transparent);
  background: color-mix(in oklab, currentColor 5%, transparent);
  color: currentColor;
  border-radius: 999px;
  padding: 7px 12px; min-height: 34px;
  font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 500;
  cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.m-qchip:active { transform: scale(0.97); }
.m-qchip-primary {
  border-color: color-mix(in oklab, #7c3aed 45%, transparent);
  background: color-mix(in oklab, #7c3aed 16%, transparent);
  color: #c4b0ff; font-weight: 600;
}
.m-qchip-add { opacity: 0.7; font-style: italic; }

/* ── v3.11.0 WFH toggle + calendar + cover ──────────────────────── */
.m-loc-seg { display: flex; gap: 8px; margin: 4px 0 14px; }
.m-loc-seg button {
  flex: 1; min-height: 44px; border-radius: 12px;
  border: 1px solid color-mix(in oklab, currentColor 16%, transparent);
  background: color-mix(in oklab, currentColor 4%, transparent);
  color: currentColor; font-family: 'Manrope', sans-serif; font-size: 14px;
  font-weight: 600; cursor: pointer; touch-action: manipulation;
}
.m-loc-seg button.on {
  border-color: color-mix(in oklab, #7c3aed 50%, transparent);
  background: color-mix(in oklab, #7c3aed 16%, transparent);
  color: #c4b0ff;
}

/* Calendar */
.m-cal-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.m-cal-nav {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid color-mix(in oklab, currentColor 14%, transparent);
  background: color-mix(in oklab, currentColor 5%, transparent); color: currentColor;
  font-size: 22px; cursor: pointer; touch-action: manipulation;
}
.m-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.m-cal-dow { margin-bottom: 4px; }
.m-cal-dow-c { text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 10px; opacity: 0.5; }
.m-cal-cell {
  aspect-ratio: 1; border-radius: 10px;
  background: color-mix(in oklab, currentColor 4%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.m-cal-num { font-family: 'Manrope', sans-serif; font-size: 12px; opacity: 0.85; }
.m-cal-dot { width: 7px; height: 7px; border-radius: 50%; }
.m-cal-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.m-cal-leg { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; opacity: 0.8; }
.m-cal-totals { margin-top: 8px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; opacity: 0.6; }

/* Cover request */
.m-cover-btn {
  min-height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid color-mix(in oklab, #ffd28a 40%, transparent);
  background: color-mix(in oklab, #ffd28a 12%, transparent);
  color: #ffd28a; font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 600;
  cursor: pointer; touch-action: manipulation; margin-left: auto;
}
.m-cover-sent { margin-left: auto; font-size: 11.5px; color: #8fe0ab; font-weight: 600; }

/* ── v3.12 trusted one-tap + Face ID login ──────────────────────── */
.m-login-faceid {
  width: 100%; min-height: 48px; margin-top: 10px;
  border-radius: 14px;
  border: 1px solid #7c3aed66;
  background: #7c3aed18; color: #c4b0ff;
  font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 600;
  cursor: pointer; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.m-login-faceid:active { transform: scale(0.99); }
.m-login-faceid:disabled { opacity: 0.5; }

/* ── v3.12 PTO request sheet + export buttons ───────────────────── */
.m-pto-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.m-pto-type {
  min-height: 46px; border-radius: 12px;
  border: 1px solid color-mix(in oklab, currentColor 16%, transparent);
  background: color-mix(in oklab, currentColor 4%, transparent);
  color: currentColor; font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; touch-action: manipulation;
}
.m-pto-type.on {
  border-color: color-mix(in oklab, #7c3aed 50%, transparent);
  background: color-mix(in oklab, #7c3aed 16%, transparent); color: #c4b0ff;
}
.m-pto-dates { display: flex; gap: 10px; margin-bottom: 6px; }
.m-pto-date { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.m-pto-date span { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.55; }
.m-pto-date input {
  min-height: 44px; border-radius: 10px; padding: 0 10px;
  border: 1px solid color-mix(in oklab, currentColor 16%, transparent);
  background: color-mix(in oklab, currentColor 4%, transparent);
  color: currentColor; font-family: 'Manrope', sans-serif; font-size: 14px;
}
.m-export-btn {
  min-height: 36px; padding: 0 14px; border-radius: 10px;
  border: 1px solid color-mix(in oklab, #7c3aed 40%, transparent);
  background: color-mix(in oklab, #7c3aed 12%, transparent); color: #c4b0ff;
  font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; touch-action: manipulation;
}
.m-export-btn:disabled { opacity: 0.5; }

/* ── v4.0.0 Pulse — embedded assistant ──────────────────────────────── */
.m-pulse-launch {
  position: fixed; right: 16px;
  bottom: calc(150px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 28px; border: none;
  background: radial-gradient(120% 120% at 50% 25%, #8b5cf6 0%, #6d28d9 55%, #4c1d95 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 34px -10px #7c3aedcc, 0 2px 8px #0006;
  cursor: pointer; z-index: 45; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.m-pulse-launch:active { transform: scale(.94); }
.m-pulse-ring {
  position: absolute; inset: -4px; border-radius: 32px;
  border: 2px solid #a78bfa88; opacity: 0; pointer-events: none;
  animation: m-pulse-ring 2.6s ease-out infinite;
}
@keyframes m-pulse-ring { 0% { transform: scale(.85); opacity: .7; } 70% { transform: scale(1.25); opacity: 0; } 100% { opacity: 0; } }
.m-pulse-mark.on { animation: m-pulse-beat 1.1s ease-in-out infinite; }
@keyframes m-pulse-beat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.m-pulse-panel {
  position: fixed; right: 8px; left: auto;
  bottom: calc(8px + env(safe-area-inset-bottom));
  width: min(440px, calc(100vw - 16px));
  height: min(640px, calc(100vh - 80px));
  display: flex; flex-direction: column;
  border-radius: 22px; overflow: hidden; z-index: 60;
  box-shadow: 0 24px 60px -12px #000a, 0 4px 16px #0006;
  animation: m-pulse-in .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes m-pulse-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.m-dark  .m-pulse-panel { background: #0a0a0c; border: 1px solid #ffffff14; }
.m-light .m-pulse-panel { background: #fff; border: 1px solid #1a1a1a12; }
.m-pulse-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 12px 14px; gap: 8px;
  background: linear-gradient(135deg, #6d28d9, #4c1d95); color: #fff; flex: 0 0 auto;
}
.m-pulse-hd-l { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.m-pulse-hd-r { display: flex; align-items: center; gap: 2px; }
.m-pulse-ic { width: 36px; height: 36px; border-radius: 10px; border: none; background: transparent; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.m-pulse-ic:active { background: #ffffff22; }
.m-pulse-models { padding: 8px 12px; border-bottom: 1px solid; }
.m-dark  .m-pulse-models { background: #0c0c0e; border-color: #ffffff10; }
.m-light .m-pulse-models { background: #faf8f3; border-color: #1a1a1a10; }
.m-pulse-models select { width: 100%; padding: 10px 12px; border-radius: 10px; font-size: 14px; -webkit-appearance: none; appearance: none; }
.m-dark  .m-pulse-models select { background: #161618; color: #f3f1ec; border: 1px solid #ffffff18; }
.m-light .m-pulse-models select { background: #fff; color: #1a1a1a; border: 1px solid #1a1a1a1a; }
.m-pulse-chat { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 10px; }
.m-pulse-row { display: flex; flex-direction: column; max-width: 100%; }
.m-pulse-row.m-pulse-you { align-items: flex-end; }
.m-pulse-bubble { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere; }
.m-pulse-bubble ul { margin: 4px 0 0; padding-left: 18px; }
.m-pulse-bubble li { margin: 2px 0; }
.m-pulse-bubble code { font-size: 12.5px; padding: 1px 5px; border-radius: 5px; }
.m-dark  .m-pulse-bubble code { background: #ffffff14; }
.m-light .m-pulse-bubble code { background: #1a1a1a10; }
.m-pulse-row:not(.m-pulse-you) .m-pulse-bubble { border-bottom-left-radius: 5px; }
.m-dark  .m-pulse-row:not(.m-pulse-you) .m-pulse-bubble { background: #161618; color: #f3f1ec; }
.m-light .m-pulse-row:not(.m-pulse-you) .m-pulse-bubble { background: #f3eef9; color: #2c1856; }
.m-pulse-you .m-pulse-bubble { border-bottom-right-radius: 5px; background: linear-gradient(135deg, #7c3aed, #5b21b6); color: #fff; }
.m-pulse-typing { display: flex; gap: 4px; align-items: center; }
.m-pulse-typing span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .4; animation: m-pulse-dot 1s infinite; }
.m-pulse-typing span:nth-child(2) { animation-delay: .15s; }
.m-pulse-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes m-pulse-dot { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.m-pulse-confirm { display: flex; gap: 8px; margin-top: 8px; }
.m-pulse-yes, .m-pulse-no { flex: 1; padding: 11px 14px; border-radius: 11px; font-size: 14px; font-weight: 700; border: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.m-pulse-yes { background: linear-gradient(135deg, #7c3aed, #5b21b6); color: #fff; }
.m-pulse-yes:active { transform: scale(.97); }
.m-dark  .m-pulse-no { background: #1c1c1f; color: #f3f1ec; }
.m-light .m-pulse-no { background: #efeae6; color: #1a1a1a; }
.m-pulse-yes:disabled, .m-pulse-no:disabled { opacity: .5; }
.m-pulse-goto { align-self: flex-start; margin-top: 7px; padding: 8px 13px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid #7c3aed55; background: #7c3aed14; color: #7c3aed; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.m-light .m-pulse-goto { color: #5b21b6; }
.m-pulse-goto:active { background: #7c3aed28; }
.m-pulse-suggest { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.m-pulse-suggest button { padding: 9px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent; }
.m-dark  .m-pulse-suggest button { background: #131315; color: #cfc8e6; border: 1px solid #ffffff12; }
.m-light .m-pulse-suggest button { background: #f3eef9; color: #4c2a86; border: 1px solid #1a1a1a0a; }
.m-pulse-suggest button:active { transform: scale(.97); }
.m-pulse-input { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 11px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid; }
.m-dark  .m-pulse-input { background: #0a0a0c; border-color: #ffffff12; }
.m-light .m-pulse-input { background: #fff; border-color: #1a1a1a10; }
.m-pulse-input input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 999px; font-size: 15px; outline: none; }
.m-dark  .m-pulse-input input { background: #161618; color: #f3f1ec; border: 1px solid #ffffff14; }
.m-light .m-pulse-input input { background: #f5f2ee; color: #1a1a1a; border: 1px solid #1a1a1a10; }
.m-pulse-mic, .m-pulse-send { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent; }
.m-dark  .m-pulse-mic { background: #1c1c1f; color: #cbb9f5; }
.m-light .m-pulse-mic { background: #f0eaf9; color: #6d28d9; }
.m-pulse-mic.on { background: #dc2626; color: #fff; animation: m-pulse-beat 1s infinite; }
.m-pulse-send { background: linear-gradient(135deg, #7c3aed, #5b21b6); color: #fff; }
.m-pulse-send:disabled { opacity: .45; }
.m-pulse-send:active { transform: scale(.94); }

/* v4.1.0 — Pulse nudges (proactive prompts) */
.m-pulse-nudges { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.m-pulse-nudge {
  display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer;
  padding: 11px 13px; border-radius: 13px; font-size: 13.5px; font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
.m-dark  .m-pulse-nudge { background: #1a1330; color: #e7defc; border: 1px solid #7c3aed40; }
.m-light .m-pulse-nudge { background: #f3eef9; color: #3a2168; border: 1px solid #7c3aed26; }
.m-pulse-nudge:active { transform: scale(.985); }
.m-pulse-nudge-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; background: #8b5cf6; box-shadow: 0 0 0 4px #8b5cf622; }

/* v4.2.0 — Sentinel mascot on login + onboarding */
.m-login-mascot, .m-onboard-mascot { display: flex; justify-content: center; }
.m-login-mascot svg, .m-onboard-mascot svg { filter: drop-shadow(0 16px 44px #2dd4bf2e) drop-shadow(0 6px 22px #0008); border-radius: 50%; }

/* v4.3.0 — RTL (Arabic) adjustments. dir="rtl" on <html> handles most flips;
   these fix the fixed-position Pulse surfaces + keep numeric/mono text LTR. */
.m-rtl .m-pulse-panel { right: auto; left: 8px; }
.m-rtl .m-pulse-launch { right: auto; left: 16px; }
.m-rtl .m-pulse-you { align-items: flex-start; }
.m-rtl .m-pulse-row.m-pulse-pulse, .m-rtl .m-pulse-row:not(.m-pulse-you) { align-items: flex-end; }
.m-rtl .m-mono, .m-mono { unicode-bidi: plaintext; }
.m-rtl .m-pulse-goto, .m-rtl .m-pulse-nudge { text-align: right; }
/* keep the bottom tab bar order natural in RTL (icons are symmetric) */
.m-rtl .m-tabbar { direction: rtl; }
