/* ============================================================================
   ATLAS REDESIGN — Mobile app preview screen styles  ·  Phase 2 (Wave 2E)
   Branch: atlas-redesign-2026-06-29

   Prefix: .rd-mobile. Tokens only (--r-*) so Calm (almanac) + Operator themes
   both work automatically. No hardcoded hex. The phone DEVICE CHROME (bezel,
   status bar, tab bar) is decorative; ALL DATA inside is real-or-em-dash.

   The phone screen is a self-contained Calm "mini-Home" — but because the whole
   app rides on --r-* tokens, the inner phone surface inherits the active theme.
   Theme-specific selectors (html[data-rtheme="operator"] …) are used only where
   a token can't express the tweak (the dark bezel reads correctly in both).
   ========================================================================== */

.rd-mobile {
  font-family: var(--r-font-body);
  color: var(--r-body);
  padding: var(--r-gutter);
  max-width: var(--r-page-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

/* ---- page header --------------------------------------------------------- */
.rd-mob-head {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.rd-mob-eyebrow {
  margin: 0;
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-eyebrow);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--r-clay);
}
.rd-mob-h1 {
  margin: 0;
  font-family: var(--r-font-display);
  font-size: var(--r-fs-h1);
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.1;
  color: var(--r-ink);
}
.rd-mob-sub {
  margin: 2px 0 0;
  font-size: var(--r-fs-body);
  color: var(--r-muted);
  max-width: 600px;
  line-height: 1.5;
}

/* ---- device stage -------------------------------------------------------- */
.rd-mob-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14px 0 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* the dark bezel — decorative; uses ink-toned tokens so it reads as a phone
   shell in BOTH themes (a near-black device against the work surface). */
.rd-mob-device {
  position: relative; /* anchors the decorative hardware details below */
  width: 392px;
  flex: none;
  border: 11px solid var(--r-device-bezel);
  border-radius: 50px;
  background: var(--r-device-bezel);
  /* glossy hardware edge — a thin light hairline reads as a bezel highlight in
     BOTH themes (the bezel itself is near-black regardless of theme). */
  box-shadow: var(--r-shadow-pop), inset 0 0 0 1px rgba(255, 255, 255, .05), inset 0 1.5px 0 rgba(255, 255, 255, .08);
}
html[data-rtheme="operator"] .rd-mob-device {
  /* hairline edge so the pure-black bezel separates from the operator canvas */
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .8), 0 0 0 1px var(--r-border), inset 0 1.5px 0 rgba(255, 255, 255, .05);
}
/* power button — right edge, protruding slightly for a real-hardware read */
.rd-mob-device::before {
  content: "";
  position: absolute;
  right: -3px;
  top: 132px;
  width: 3px;
  height: 64px;
  border-radius: 0 3px 3px 0;
  background: var(--r-device-bezel);
  filter: brightness(1.4);
}
/* volume rocker — left edge, two nubs (second nub via box-shadow copy) */
.rd-mob-device::after {
  content: "";
  position: absolute;
  left: -3px;
  top: 108px;
  width: 3px;
  height: 34px;
  border-radius: 3px 0 0 3px;
  background: var(--r-device-bezel);
  filter: brightness(1.4);
  box-shadow: 0 52px 0 0 var(--r-device-bezel);
}

/* inner screen — a real Atlas surface */
.rd-mob-screen {
  width: 370px;
  height: 744px;
  max-height: calc(100vh - 220px);
  border-radius: 40px;
  overflow: hidden;
  background: var(--r-canvas);
  display: flex;
  flex-direction: column;
  position: relative;
}
/* dynamic-island notch — decorative, floats above the status bar */
.rd-mob-screen::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  height: 22px;
  border-radius: 12px;
  background: var(--r-device-bezel);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  z-index: 5;
  pointer-events: none;
}

/* ---- status bar (decorative) --------------------------------------------- */
.rd-mob-statusbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px 4px;
  font-family: var(--r-font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--r-ink);
}
.rd-mob-sysicons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--r-ink);
}

/* ---- app body (scrolls inside the phone; outer frame never scrolls) ------ */
.rd-mob-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 16px 16px;
  min-height: 0;
}

/* greeting */
.rd-mob-greet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.rd-mob-greet__hi {
  font-size: 12px;
  color: var(--r-muted);
}
.rd-mob-greet__name {
  font-family: var(--r-font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--r-ink);
}
.rd-mob-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--r-primary);
  color: var(--r-primary-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--r-font-mono);
  font-size: 13px;
  font-weight: 600;
  flex: none;
  box-shadow: var(--r-shadow-card);
}

/* gross commission card — the phone screen's hero metric, marked with a thin
   primary accent bar so it reads first in the content hierarchy. */
.rd-mob-gci {
  position: relative;
  overflow: hidden;
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-radius: 16px;
  box-shadow: var(--r-shadow-card);
  padding: 16px 18px;
}
.rd-mob-gci::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--r-primary), var(--r-primary-2));
}
.rd-mob-gci__label {
  font-family: var(--r-font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--r-faint);
}
.rd-mob-gci__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.rd-mob-gci__value {
  font-family: var(--r-font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--r-ink);
}
.rd-mob-gci__delta {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--r-good);
}
.rd-mob-gci__delta[data-dir="down"] { color: var(--r-clay-2); }

/* sparkline */
.rd-mob-spark { display: block; flex: none; }
.rd-mob-spark__line {
  stroke: var(--r-primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.rd-mob-spark__base {
  stroke: var(--r-hairline-2);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 3 4;
}

/* two stat tiles */
.rd-mob-tiles {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.rd-mob-tile {
  flex: 1 1 0;
  min-width: 0;
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-radius: 14px;
  box-shadow: var(--r-shadow-card);
  padding: 12px 14px;
}
.rd-mob-tile__label {
  font-family: var(--r-font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--r-faint);
}
.rd-mob-tile__value {
  font-family: var(--r-font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--r-ink);
  margin-top: 2px;
}

/* section heads */
.rd-mob-secthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 4px 8px;
}
.rd-mob-secthead__title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--r-font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--r-ink);
}
.rd-mob-secthead__title svg { flex: none; color: var(--r-primary); }
.rd-mob-secthead__meta {
  font-size: 12px;
  color: var(--r-muted);
}
.rd-mob-secthead__pill {
  font-family: var(--r-font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--r-clay-2);
  background: color-mix(in srgb, var(--r-clay) 16%, transparent);
  border-radius: var(--r-radius-pill);
  padding: 1px 8px;
}

/* generic list card */
.rd-mob-list {
  background: var(--r-surface);
  border: 1px solid var(--r-border);
  border-radius: 14px;
  box-shadow: var(--r-shadow-card);
  overflow: hidden;
}

/* one "Today" row */
.rd-mob-li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-top: 1px solid var(--r-hairline);
}
.rd-mob-li:first-child { border-top: none; }
.rd-mob-li__time {
  flex: none;
  width: 44px;
  font-family: var(--r-font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--r-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rd-mob-li__time.is-warn { color: var(--r-clay); }
.rd-mob-li__title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--r-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rd-mob-li__ico {
  flex: none;
  display: inline-flex;
  color: var(--r-faint);
}
.rd-mob-li__ico.is-warn { color: var(--r-clay); }

/* one follow-up row */
.rd-mob-fu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-top: 1px solid var(--r-hairline);
}
.rd-mob-fu:first-child { border-top: none; }
.rd-mob-fu__av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--r-font-mono);
  font-size: 9px;
  font-weight: 600;
  background: var(--r-well);
  color: var(--r-muted);
}
.rd-mob-fu__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.rd-mob-fu__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--r-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rd-mob-fu__reason {
  font-size: 12px;
  color: var(--r-clay);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rd-mob-fu__call {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--r-border);
  background: var(--r-surface);
  color: var(--r-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--r-dur) var(--r-ease),
              box-shadow var(--r-dur) var(--r-ease),
              transform var(--r-dur) var(--r-ease);
}
.rd-mob-fu__call:hover {
  background: var(--r-canvas-raised);
  box-shadow: var(--r-shadow-hover);
  transform: translateY(-1px);
}
.rd-mob-fu__call:active { transform: translateY(0); }
.rd-mob-fu__call:focus-visible { outline: var(--r-focus); outline-offset: 2px; }

/* honest empty / loading state inside a list card */
.rd-mob-empty {
  font-family: var(--r-font-mono);
  font-size: var(--r-fs-meta);
  letter-spacing: .02em;
  color: var(--r-faint);
  text-align: center;
  padding: 18px 12px;
}

/* quick actions (static UI) */
.rd-mob-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.rd-mob-act {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--r-surface);
  color: var(--r-body);
  border: 1px solid var(--r-border);
  border-radius: 13px;
  padding: 11px 0;
  font-size: 12px;
  font-weight: 600;
}
.rd-mob-act svg { color: var(--r-primary); }
.rd-mob-act--primary {
  background: var(--r-primary);
  color: var(--r-primary-ink);
  border-color: var(--r-primary);
}
.rd-mob-act--primary svg { color: var(--r-primary-ink); }

/* ---- bottom tab bar (decorative) ----------------------------------------- */
.rd-mob-tabbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 14px 18px;
  border-top: 1px solid var(--r-hairline-2);
  background: var(--r-canvas-raised);
}
.rd-mob-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--r-faint);
}
.rd-mob-tab.is-active { color: var(--r-primary); }
.rd-mob-tab--fab {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--r-primary);
  color: var(--r-primary-ink);
  margin-top: -22px;
  box-shadow: var(--r-shadow-hover);
}

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 980px) {
  .rd-mob-device { width: 100%; max-width: 392px; }
}
@media (max-width: 720px) {
  .rd-mob-device {
    width: 100%;
    max-width: 360px;
    border-width: 9px;
    border-radius: 42px;
  }
  .rd-mob-screen { width: 100%; border-radius: 34px; }
  .rd-mob-actions { flex-wrap: wrap; }
  .rd-mob-act { flex: 1 1 calc(50% - 4px); }
}
