/* ============================================================
   SXMeets Mobile OS v3 — chassis components
   ------------------------------------------------------------
   Action-mode chip, status-strip base, online/offline toggle,
   KPI strip, section heading, card, tag, tabbar item, sheet
   primitive (visual), toast primitive, milestone tier card,
   weekly grid skeleton, profile card, settings row.

   The HERO GRADIENTS for status modes stay per-OS (they are
   the brand voice). This file styles the structure; the OS
   file maps [data-mode="..."] → --hero-*.

   Depends on: chassis-tokens.css, chassis-layout.css.
   Extracted 2026-05-29 from Batch 1 v3 files (4/4 match).
   ============================================================ */

/* ════════════════════════════════════════════════════════════
   ACTION-MODE CHIP — persistent pill in appbar, every screen.
   Mount with onclick="openActionMode()" or
   onclick="SX_CHASSIS.chip.open()" depending on which API the
   OS file uses.
   ────────────────────────────────────────────────────────────
   Naming variation across Batch 1:
     • RestoOS  → .action-chip
     • Hospitality → .action-chip
     • Beauty   → .am-chip
     • Wellness → .amc
   All four share .action-chip styling here. Aliases included
   so any of the 4 Batch 1 file names still pick up the styles.
   ════════════════════════════════════════════════════════════ */
.action-chip,
.am-chip,
.amc {
  display: inline-flex; align-items: center; gap: 5px;
  height: 36px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer;
  color: var(--ink-2); font-family: var(--mono);
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  transition: background .12s, border-color .12s, color .12s;
  flex: 0 0 auto;
}
.action-chip:hover, .action-chip:active,
.am-chip:hover, .am-chip:active,
.amc:hover, .amc:active {
  background: var(--surface-2); border-color: var(--accent); color: var(--accent);
}
.action-chip .chip-ico,
.am-chip .chip-ico,
.amc .chip-ico {
  font-size: 13px; line-height: 1; opacity: .9;
}
.action-chip .chip-ico svg,
.am-chip .chip-ico svg,
.amc .chip-ico svg {
  width: 14px; height: 14px;
}
.action-chip .chip-lab,
.am-chip .chip-lab,
.amc .chip-lab { display: inline; }
@media (max-width: 360px) {
  .action-chip .chip-lab,
  .am-chip .chip-lab,
  .amc .chip-lab { display: none; }
}

/* ════════════════════════════════════════════════════════════
   STATUS STRIP — hero block in tab-1.
   Per-OS files map their mode names to the --hero-* gradient
   tokens (e.g. [data-mode="serving"] → var(--hero-ride)).
   Default mapping below covers the standard taxios state names.
   ════════════════════════════════════════════════════════════ */
.status-strip {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 14px 16px;
  background: var(--hero-offline);
  border: 1px solid var(--line);
  margin-bottom: 12px; min-height: 88px;
  display: flex; flex-direction: column; gap: 8px;
  transition: background .3s;
}
[data-mode="online_idle"] .status-strip { background: var(--hero-idle);  border-color: var(--accent-glow); }
[data-mode="online_surge"] .status-strip { background: var(--hero-surge); border-color: var(--accent-glow); }
[data-mode^="active_"]    .status-strip { background: var(--hero-ride);  border-color: var(--accent-glow); }

.status-strip .meta {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px;
  color: rgba(255,255,255,.78); letter-spacing: .12em;
  text-transform: uppercase; font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
[data-theme="light"] .status-strip .meta { color: rgba(20,22,28,.78); }
[data-theme="light"][data-mode^="active_"] .status-strip .meta,
[data-theme="light"][data-mode="online_surge"] .status-strip .meta { color: rgba(255,255,255,.92); }

.status-strip .meta .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--offline);
  box-shadow: 0 0 0 0 currentColor;
}
[data-mode="online_idle"] .status-strip .meta .pulse,
[data-mode="online_surge"] .status-strip .meta .pulse { background: var(--online); animation: chassisPulse 2s ease-in-out infinite; }
[data-mode^="active_"]    .status-strip .meta .pulse { background: var(--info);   animation: chassisPulse 2s ease-in-out infinite; }
@keyframes chassisPulse {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50%  { opacity: .55; }
  100% { box-shadow: 0 0 0 8px transparent; opacity: 1; }
}

.status-strip .headline {
  font-size: 20px; font-weight: 600; color: #fff;
  letter-spacing: -.015em; line-height: 1.2;
  margin: 0;
}
[data-theme="light"] .status-strip .headline { color: var(--ink); }
[data-theme="light"][data-mode^="active_"] .status-strip .headline,
[data-theme="light"][data-mode="online_surge"] .status-strip .headline,
[data-theme="light"][data-mode="online_idle"] .status-strip .headline { color: #fff; }

.status-strip .sub {
  font-size: 12px; color: rgba(255,255,255,.78);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
[data-theme="light"] .status-strip .sub { color: rgba(20,22,28,.7); }
[data-theme="light"][data-mode^="active_"] .status-strip .sub,
[data-theme="light"][data-mode="online_surge"] .status-strip .sub,
[data-theme="light"][data-mode="online_idle"] .status-strip .sub { color: rgba(255,255,255,.82); }

/* ════════════════════════════════════════════════════════════
   ONLINE / OFFLINE TOGGLE
   ════════════════════════════════════════════════════════════ */
.online-toggle {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; width: 100%;
  margin-bottom: 12px;
  transition: background .15s, border-color .15s;
  border: 1px solid var(--line);
  letter-spacing: -.005em;
  min-height: 64px;
}
.online-toggle .label { display: flex; align-items: center; gap: 10px; }
.online-toggle .swatch {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--offline);
  flex: 0 0 auto;
}
[data-mode="online_idle"] .online-toggle .swatch,
[data-mode="online_surge"] .online-toggle .swatch { background: var(--online); box-shadow: 0 0 12px rgba(52,211,153,.6); }
.online-toggle .switch {
  width: 48px; height: 28px; border-radius: 14px;
  background: var(--surface-3);
  position: relative; flex: 0 0 auto;
  transition: background .2s;
}
.online-toggle .switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); transition: transform .2s, background .2s;
}
[data-mode="online_idle"]  .online-toggle .switch,
[data-mode="online_surge"] .online-toggle .switch,
[data-mode^="active_"]     .online-toggle .switch { background: var(--online-deep); }
[data-mode="online_idle"]  .online-toggle .switch::after,
[data-mode="online_surge"] .online-toggle .switch::after,
[data-mode^="active_"]     .online-toggle .switch::after { transform: translateX(20px); background: #fff; }

/* ════════════════════════════════════════════════════════════
   KPI STRIP — 4-up grid
   ════════════════════════════════════════════════════════════ */
.kpi-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border-radius: var(--r-md);
  overflow: hidden; margin-bottom: 14px;
  border: 1px solid var(--line);
}
.kpi {
  background: var(--surface); padding: 11px 9px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
}
.kpi .lab {
  font-family: var(--mono); font-size: 8.5px;
  color: var(--ink-3); letter-spacing: .1em;
  text-transform: uppercase; font-weight: 600;
}
.kpi .val {
  font-family: var(--mono); font-weight: 600; font-size: 17px;
  color: var(--ink); font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; line-height: 1.1;
}
.kpi .delta {
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kpi .delta.up    { color: var(--online); }
.kpi .delta.down  { color: var(--alert); }
.kpi .delta.warn  { color: var(--accent); }
.kpi .delta.flat  { color: var(--ink-3); }

/* ════════════════════════════════════════════════════════════
   SECTION HEAD
   ════════════════════════════════════════════════════════════ */
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 4px 8px;
}
.sec-head h3 {
  margin: 0; font-size: 13px; font-weight: 600; color: var(--ink);
  letter-spacing: -.01em;
}
.sec-head .ctrl {
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: .08em;
  text-transform: uppercase; font-weight: 600;
  background: none; border: 0; cursor: pointer;
}
.sec-head .ctrl:hover { color: var(--accent); }

/* ════════════════════════════════════════════════════════════
   CARD
   ════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 8px;
  transition: border-color .12s, background .12s;
}
.card.tappable { cursor: pointer; }
.card.tappable:hover, .card.tappable:active {
  border-color: var(--line-2); background: var(--surface-2);
}
.card.accent { border-color: var(--accent-glow); }
.card-row { display: flex; align-items: center; gap: 10px; }
.card-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 12px;
  color: var(--ink); flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.card-icon.accent { background: var(--accent-glow); color: var(--accent); border-color: var(--accent-glow); }
.card-icon.online { background: rgba(52,211,153,.14); color: var(--online); border-color: rgba(52,211,153,.3); }
.card-icon.alert  { background: rgba(248,113,113,.14); color: var(--alert);  border-color: rgba(248,113,113,.3); }
.card-icon.info   { background: rgba(96,165,250,.14); color: var(--info);   border-color: rgba(96,165,250,.3); }
.card-info { flex: 1; min-width: 0; }
.card-title {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  line-height: 1.25; letter-spacing: -.005em;
}
.card-sub {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
  letter-spacing: .02em; margin-top: 2px;
}
.card-val {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--ink); font-variant-numeric: tabular-nums;
  flex: 0 0 auto; text-align: right;
}
.card-val.up   { color: var(--online); }
.card-val.warn { color: var(--accent); }
.card-val.alert{ color: var(--alert); }

/* ════════════════════════════════════════════════════════════
   TAG
   ════════════════════════════════════════════════════════════ */
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
.tag.accent { background: var(--accent-glow); color: var(--accent); border-color: var(--accent-glow); }
.tag.online { background: rgba(52,211,153,.14); color: var(--online); border-color: rgba(52,211,153,.3); }
.tag.alert  { background: rgba(248,113,113,.14); color: var(--alert);  border-color: rgba(248,113,113,.3); }
.tag.info   { background: rgba(96,165,250,.14); color: var(--info);   border-color: rgba(96,165,250,.3); }

/* ════════════════════════════════════════════════════════════
   BOTTOM TABBAR ITEM
   ════════════════════════════════════════════════════════════ */
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 0; padding: 6px 0;
  color: var(--ink-3); cursor: pointer;
  font-family: var(--font); font-size: 9.5px; font-weight: 600;
  letter-spacing: .04em; position: relative;
}
.tab.active { color: var(--accent); }
.tab svg { width: 22px; height: 22px; display: block; }
.tab .tab-dot {
  position: absolute; top: 4px; right: calc(50% - 16px);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--alert);
}

/* ════════════════════════════════════════════════════════════
   SHEET PRIMITIVE (visual — positioning lives in chassis-layout.css)
   ════════════════════════════════════════════════════════════ */
.sheet {
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 22px 18px 32px;
  border: 1px solid var(--line); border-bottom: 0;
}
.sheet .handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--surface-3);
  margin: -10px auto 16px;
}
.sheet h2 {
  margin: 0 0 4px; font-size: 17px; font-weight: 600; color: var(--ink);
  letter-spacing: -.01em;
}
.sheet .sheet-sub {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  margin-bottom: 16px; font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

/* Action-mode sheet cards */
.am-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; margin-bottom: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.am-card:hover, .am-card:active {
  border-color: var(--accent); background: var(--surface-3);
}
.am-card .am-ico {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-glow); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; flex: 0 0 auto;
  border: 1px solid var(--accent-glow);
}
.am-card .am-info { flex: 1; min-width: 0; }
.am-card .am-title,
.am-card .am-name {
  font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -.005em;
}
.am-card .am-sub {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  letter-spacing: .04em; margin-top: 2px;
}
.am-card .am-extra {
  font-family: var(--mono); font-size: 9.5px; color: var(--ink-3);
  margin-top: 2px; opacity: .85;
}
.am-card .am-chev { color: var(--ink-3); }
.am-empty {
  padding: 24px 12px; text-align: center;
  color: var(--ink-3); font-family: var(--mono); font-size: 11px;
  letter-spacing: .04em;
}

/* ════════════════════════════════════════════════════════════
   TOAST PRIMITIVE
   ════════════════════════════════════════════════════════════ */
.toast {
  background: rgba(24,27,34,.94);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--info);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
  transform: translateY(-120%);
  opacity: 0;
  transition: transform .25s cubic-bezier(.32,.72,.30,1), opacity .2s;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,.5);
}
[data-theme="light"] .toast { background: rgba(255,255,255,.96); border-color: var(--line-2); }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left-color: var(--online); }
.toast.warn    { border-left-color: var(--accent); }
.toast.alert   { border-left-color: var(--alert); }
.toast.info    { border-left-color: var(--info); }
.toast .ti {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  color: var(--ink);
}
.toast .tt {
  flex: 1; min-width: 0;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  line-height: 1.3;
}
.toast .tt small {
  display: block; font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-3); font-weight: 500; margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════════════════════
   MILESTONE TIER CARD — used in Me / Milestones screen.
   3 of 4 Batch 1 files render this; styling matches.
   ════════════════════════════════════════════════════════════ */
.milestone-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px;
  margin-bottom: 8px;
  display: flex; gap: 12px; align-items: center;
}
.milestone-card .ms-ico {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-glow); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--accent-glow);
}
.milestone-card.locked .ms-ico { opacity: .35; }
.milestone-card .ms-info { flex: 1; min-width: 0; }
.milestone-card .ms-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.milestone-card .ms-sub {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  margin-top: 2px; letter-spacing: .04em;
}
.milestone-card .ms-bar {
  width: 100%; height: 4px; border-radius: 2px;
  background: var(--surface-3); overflow: hidden;
  margin-top: 8px;
}
.milestone-card .ms-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-deep) 100%);
  border-radius: 2px;
  transition: width .3s ease-out;
}

/* ════════════════════════════════════════════════════════════
   WEEKLY SUMMARY GRID SKELETON — 7-day grid + best-day highlight.
   Used in earnings / week screens. 3 of 4 Batch 1 files use it.
   ════════════════════════════════════════════════════════════ */
.week-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin-bottom: 12px;
}
.week-day {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 76px;
}
.week-day .d-lab {
  font-family: var(--mono); font-size: 9px;
  color: var(--ink-3); letter-spacing: .1em;
  text-transform: uppercase; font-weight: 600;
}
.week-day .d-val {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.week-day.best {
  background: var(--accent-glow); border-color: var(--accent);
}
.week-day.best .d-val { color: var(--accent); }
.week-day.future { opacity: .4; border-style: dashed; }

/* ════════════════════════════════════════════════════════════
   PROFILE CARD + SETTINGS ROW — Me / Settings screens
   ════════════════════════════════════════════════════════════ */
.profile-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px;
  margin-bottom: 14px; display: flex; gap: 14px; align-items: center;
}
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: var(--ink-on-accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 24px; letter-spacing: -.02em;
  flex: 0 0 auto;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.profile-card .name { font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.profile-card .meta {
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-3); margin-top: 3px;
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.profile-card .tier {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  background: var(--accent-glow); color: var(--accent);
  padding: 3px 7px; border-radius: 4px; margin-top: 6px;
  letter-spacing: .12em; text-transform: uppercase;
}

.settings {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
  margin-bottom: 10px;
}
.set-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s;
}
.set-row:last-child { border-bottom: 0; }
.set-row:hover, .set-row:active { background: var(--surface-2); }
.set-row .ico {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2); flex: 0 0 auto;
}
.set-row .lab { flex: 1; font-size: 13px; color: var(--ink); font-weight: 500; }
.set-row .val { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.set-row .chev { color: var(--ink-3); }

.toggle {
  width: 42px; height: 24px; border-radius: 12px;
  background: var(--surface-3); position: relative; cursor: pointer;
  border: 0; padding: 0; flex: 0 0 auto;
  transition: background .15s;
}
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .15s;
}
.toggle.on { background: var(--online-deep); }
.toggle.on::after { transform: translateX(18px); }

.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
}
.status-dot.valid   { background: var(--online); box-shadow: 0 0 0 3px rgba(52,211,153,.12); }
.status-dot.warn    { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.status-dot.expired { background: var(--alert);  box-shadow: 0 0 0 3px rgba(248,113,113,.14); }
