/* ─────────────────────────────────────────────────────────────────────────
 * wf-mobile · mobile-shell.css
 * Mobile app chrome: header, content, bottom tabs, primitives.
 * ───────────────────────────────────────────────────────────────────────── */

.wm-app {
  position: absolute;
  top: 54px; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink-900);
  background: var(--paper);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02','cv03','cv11','ss01';
}
/* Android has shorter status bar */
.wf-android .wm-app { top: 38px; }
.wf-ipad .wm-app { top: 54px; }

/* Header */
.wm-header {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px 12px;
  background: transparent;
  flex-shrink: 0;
}
.wm-header[data-variant="solid"] {
  background: var(--surface);
  border-bottom: .5px solid var(--ink-200);
}
.wm-header .wm-hd-title {
  font-family: 'Fraunces', 'Inter', serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -.02em;
  color: var(--ink-950);
}
.wm-header .wm-hd-sub {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 2px;
}
.wm-header .wm-hd-actions {
  display: flex; align-items: center; gap: 8px;
}
.wm-icon-btn {
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 0;
  background: var(--ink-100);
  color: var(--ink-800);
  display: grid; place-items: center;
  transition: background .15s var(--ease-ios);
}
.wm-icon-btn:active { background: var(--ink-200); transform: scale(.96); }
.wm-icon-btn .wm-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 10px; font-weight: 600;
  display: grid; place-items: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
}

/* Content */
.wm-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 20px 96px;
  scroll-behavior: smooth;
}
.wm-content::-webkit-scrollbar { display: none; }

/* On tablets, constrain reading width so it doesn't look like a stretched phone.
 * Header + tabs stay edge-to-edge; only inner content column is centered. */
.wf-ipad .wm-content { padding-left: 0; padding-right: 0; }
.wf-ipad .wm-content > * {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}
.wf-ipad .wm-header {
  padding-left: max(20px, calc((100% - 600px) / 2));
  padding-right: max(20px, calc((100% - 600px) / 2));
}

/* Stack helper */
.wm-stack { display: flex; flex-direction: column; gap: 16px; }
.wm-stack-sm { display: flex; flex-direction: column; gap: 8px; }
.wm-row { display: flex; gap: 10px; align-items: center; }

/* Section heading */
.wm-section {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 2px 10px;
}
.wm-section h3 {
  margin: 0;
  font: 600 13px/1 'Inter', sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.wm-section a {
  font-size: 13px; color: var(--brand); text-decoration: none; font-weight: 500;
}

/* Card */
.wm-card {
  background: var(--surface);
  border: .5px solid var(--ink-200);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.wm-card.elevated { box-shadow: var(--shadow-card); border-color: transparent; }
.wm-card.flat { box-shadow: none; }

/* List row (iOS list) */
.wm-list {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: .5px solid var(--ink-200);
}
.wm-list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: .5px solid var(--ink-200);
}
.wm-list-row:last-child { border-bottom: 0; }
.wm-list-row .wm-list-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--ink-100); color: var(--ink-700);
  display: grid; place-items: center; flex-shrink: 0;
}
.wm-list-row .wm-list-body { flex: 1; min-width: 0; }
.wm-list-row .wm-list-title { font-size: 15px; color: var(--ink-900); font-weight: 500; }
.wm-list-row .wm-list-sub { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.wm-list-row .wm-list-right { font-size: 14px; color: var(--ink-500); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }

/* Chip */
.wm-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-700);
  font-size: 12px; font-weight: 500;
  border: 0;
  white-space: nowrap;
}
.wm-chip.brand { background: var(--brand-50); color: var(--brand-700); }
.wm-chip.gold  { background: var(--gold-100); color: var(--gold-600); }
.wm-chip.success { background: #dcfce7; color: var(--success); }
.wm-chip.outline { background: transparent; border: .5px solid var(--ink-300); color: var(--ink-700); }
.wm-chip.active { background: var(--ink-900); color: #fff; }

.wm-chips-scroll {
  display: flex; gap: 8px;
  overflow-x: auto; padding: 4px 0 10px;
  scrollbar-width: none;
}
.wm-chips-scroll::-webkit-scrollbar { display: none; }

/* Segmented control */
.wm-seg {
  display: inline-flex;
  background: var(--ink-100);
  border-radius: 12px;
  padding: 3px;
}
.wm-seg button {
  border: 0;
  background: transparent;
  font: 500 13px/1 'Inter', sans-serif;
  color: var(--ink-700);
  padding: 8px 16px;
  border-radius: 9px;
  min-width: 88px;
  transition: all .2s var(--ease-ios);
}
.wm-seg button.active {
  background: var(--surface);
  color: var(--ink-950);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Buttons */
.wm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  font: 600 15px/1 'Inter', sans-serif;
  letter-spacing: -.01em;
  transition: all .15s var(--ease-ios);
}
.wm-btn.brand { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.wm-btn.brand:active { transform: scale(.98); background: var(--brand-700); }
.wm-btn.dark  { background: var(--ink-950); color: #fff; }
.wm-btn.ghost { background: var(--ink-100); color: var(--ink-900); }
.wm-btn.outline { background: transparent; color: var(--ink-900); border: 1px solid var(--ink-300); }
.wm-btn.danger-text { background: transparent; color: var(--danger); }
.wm-btn.full { width: 100%; }
.wm-btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.wm-btn:disabled { opacity: .5; pointer-events: none; }

/* Bottom tabs */
.wm-tabs {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 82px;
  padding: 6px 8px 22px;
  display: grid; grid-template-columns: repeat(var(--wm-tabs-count, 5), 1fr);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: .5px solid var(--ink-200);
  z-index: 50;
}
.wm-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: transparent;
  color: var(--ink-500);
  font: 500 10px/1.2 'Inter', sans-serif;
  letter-spacing: -.01em;
  padding: 6px 0;
  transition: color .2s var(--ease-ios), transform .15s var(--ease-ios);
}
.wm-tab:active { transform: scale(.94); }
.wm-tab.active { color: var(--brand); }
.wm-tab .wm-tab-icon { width: 26px; height: 26px; display: grid; place-items: center; }
.wm-tab.active .wm-tab-icon svg { stroke-width: 2.2; }

/* Bali themed wallpaper inside screen (defaults) */
.wm-bg-warm {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(232,28,33,.08), transparent 60%),
    var(--paper);
}

/* Headings */
.wm-h1 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; margin: 0; color: var(--ink-950); }
.wm-h2 { font-family: 'Fraunces', serif; font-weight: 600; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; margin: 0; color: var(--ink-950); }
.wm-h3 { font: 600 17px/1.3 'Inter', sans-serif; margin: 0; color: var(--ink-950); letter-spacing: -.01em; }
.wm-eyebrow { font: 600 11px/1 'Inter', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-500); }
.wm-muted { color: var(--ink-500); }
.wm-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.wm-num { font-family: 'Fraunces', serif; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* KPI tile */
.wm-kpi {
  flex: 1; min-width: 0;
  background: var(--surface);
  border: .5px solid var(--ink-200);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.wm-kpi .wm-kpi-label { font-size: 11px; color: var(--ink-500); letter-spacing: .04em; text-transform: uppercase; font-weight: 500; }
.wm-kpi .wm-kpi-value { font-family: 'Fraunces', serif; font-size: 22px; line-height: 1.1; margin-top: 4px; color: var(--ink-950); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wm-kpi .wm-kpi-delta { font-size: 11px; color: var(--success); margin-top: 4px; }

/* Avatar */
.wm-avatar {
  width: 40px; height: 40px;
  border-radius: 999px;
  display: grid; place-items: center;
  font: 600 14px/1 'Inter', sans-serif;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f59e0b, #b91619);
}
.wm-avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.wm-avatar.sm { width: 32px; height: 32px; font-size: 12px; }

/* Sheet (bottom modal) */
.wm-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 100;
  animation: wm-fade .2s var(--ease-out);
}
.wm-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 12px 20px 28px;
  z-index: 101;
  animation: wm-slide-up .35s var(--ease-ios);
  max-height: 80%;
  overflow-y: auto;
}
.wm-sheet-handle {
  width: 38px; height: 5px;
  border-radius: 999px;
  background: var(--ink-300);
  margin: 0 auto 16px;
}
@keyframes wm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wm-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Toast */
.wm-toast {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: 76px;
  padding: 10px 16px;
  background: rgba(28,25,23,.92);
  color: #fff;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  backdrop-filter: blur(20px);
  z-index: 200;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* Progress bar */
.wm-progress {
  height: 8px;
  background: var(--ink-100);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.wm-progress > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-600), var(--brand-700));
  border-radius: 999px;
  position: relative;
}
.wm-progress > i::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  animation: wm-shimmer 2s linear infinite;
}
@keyframes wm-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* Page enter animation */
.wm-enter { animation: wm-fade-in .35s var(--ease-out) both; }
.wm-enter > * { animation: wm-rise .4s var(--ease-out) both; }
.wm-enter > *:nth-child(1) { animation-delay: 0ms; }
.wm-enter > *:nth-child(2) { animation-delay: 40ms; }
.wm-enter > *:nth-child(3) { animation-delay: 80ms; }
.wm-enter > *:nth-child(4) { animation-delay: 120ms; }
.wm-enter > *:nth-child(5) { animation-delay: 160ms; }
.wm-enter > *:nth-child(6) { animation-delay: 200ms; }
@keyframes wm-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wm-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
