:root {
  --p-bg: #0a0e14;
  --p-surface: #121a24;
  --p-card: #1a2432;
  --p-border: rgba(255, 255, 255, 0.08);
  --p-text: #eef2f7;
  --p-muted: #8b96a8;
  --p-gold: #d4a853;
  --p-gold-dim: rgba(212, 168, 83, 0.2);
  --p-teal: #3d8b8b;
  --p-danger: #e85d5d;
  --p-safe: #5dce8c;
  --nav-h: 56px;
  --status-h: 28px;
  --font: "Tajawal", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.preview-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(ellipse at top, #1a2838, #070a0e 55%);
  color: var(--p-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 2rem;
}

.preview-top {
  text-align: center;
  max-width: 520px;
  margin-bottom: 1.25rem;
}

.preview-top .eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--p-muted);
}

.preview-top h1 {
  margin: 0.35rem 0;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
}

.preview-top p {
  margin: 0;
  color: var(--p-muted);
  font-size: 0.88rem;
}

.preview-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.preview-actions a {
  color: var(--p-gold);
  font-size: 0.85rem;
}

.phone-shell {
  position: relative;
  width: min(100%, 380px);
  aspect-ratio: 390 / 820;
  max-height: min(86vh, 820px);
  background: linear-gradient(160deg, #2a3544, #0d1118);
  border-radius: 44px;
  padding: 12px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 24px 80px rgba(0, 0, 0, 0.55);
}

.phone-inner {
  background: var(--p-bg);
  border-radius: 36px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.status-bar {
  height: var(--status-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  font-size: 0.7rem;
  color: var(--p-muted);
  flex-shrink: 0;
}

.status-bar time {
  font-variant-numeric: tabular-nums;
}

.screen-stack {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 1rem 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
}

.screen-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
}

.chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.chip {
  border: 1px solid var(--p-border);
  background: var(--p-surface);
  color: var(--p-muted);
  font-size: 0.72rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-family: inherit;
  cursor: pointer;
}

.chip.is-on {
  border-color: var(--p-gold);
  color: var(--p-gold);
  background: var(--p-gold-dim);
}

.task-card {
  background: var(--p-card);
  border: 1px solid var(--p-border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 0.65rem;
}

.task-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  line-height: 1.35;
}

.task-meta {
  font-size: 0.75rem;
  color: var(--p-muted);
  margin-bottom: 0.65rem;
}

.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.price {
  color: var(--p-gold);
  font-weight: 800;
  font-size: 0.95rem;
}

.btn-sm {
  border: none;
  background: linear-gradient(135deg, var(--p-gold), #a67c2e);
  color: #111;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
}

.hero-app {
  text-align: center;
  padding: 1.5rem 0.5rem 2rem;
}

.hero-app .logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--p-gold), #8b5a2b);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #111;
}

.hero-app h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.hero-app p {
  color: var(--p-muted);
  font-size: 0.88rem;
  margin: 0 0 1.25rem;
}

.btn-block {
  width: 100%;
  max-width: 240px;
  margin: 0 auto;
  display: block;
  padding: 0.85rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--p-gold), #a67c2e);
  color: #111;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

.detail-box {
  background: var(--p-card);
  border-radius: 14px;
  padding: 1rem;
  border: 1px solid var(--p-border);
  margin-bottom: 0.75rem;
}

.detail-box h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.detail-box .loc {
  color: var(--p-muted);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.detail-box p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--p-muted);
  line-height: 1.55;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  color: var(--p-muted);
  margin: 0.5rem 0 0.25rem;
}

.fake-input,
textarea.fake-input {
  width: 100%;
  border: 1px solid var(--p-border);
  background: var(--p-surface);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  color: var(--p-text);
  font-family: inherit;
  font-size: 0.85rem;
}

textarea.fake-input {
  min-height: 72px;
  resize: none;
}

.upload-zone {
  border: 1px dashed var(--p-border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  color: var(--p-muted);
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
}

.earn-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.earn-box {
  background: var(--p-card);
  border-radius: 12px;
  padding: 0.85rem;
  border: 1px solid var(--p-border);
}

.earn-box span {
  display: block;
  font-size: 0.72rem;
  color: var(--p-muted);
}

.earn-box strong {
  font-size: 1.1rem;
  color: var(--p-gold);
}

.tx {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--p-border);
  font-size: 0.82rem;
}

.tx:last-child {
  border-bottom: none;
}

.tx small {
  color: var(--p-muted);
  display: block;
}

.badge-pill {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--p-gold-dim);
  color: var(--p-gold);
}

.profile-head {
  text-align: center;
  padding: 0.5rem 0 1rem;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p-teal), #1e3a4a);
  margin: 0 auto 0.65rem;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
}

.map-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--p-card);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--p-border);
}

.map-av {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--p-surface);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.msg-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--p-border);
  align-items: flex-start;
}

.msg-row:last-child {
  border-bottom: none;
}

.msg-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.sos-wrap {
  text-align: center;
  padding: 1rem 0.5rem;
}

.sos-btn {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid rgba(232, 93, 93, 0.4);
  background: radial-gradient(circle at 30% 30%, #ff8a8a, var(--p-danger));
  color: #fff;
  font-size: 1.75rem;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  margin: 1rem auto;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 40px rgba(232, 93, 93, 0.35);
}

.sos-list {
  text-align: start;
  max-width: 280px;
  margin: 0 auto;
}

.sos-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--p-card);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--p-border);
}

.service-grid {
  display: grid;
  gap: 0.5rem;
}

.service-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem;
  background: var(--p-card);
  border-radius: 12px;
  border: 1px solid var(--p-border);
  font-size: 0.85rem;
}

.service-cell span {
  color: var(--p-safe);
  font-weight: 700;
  font-size: 0.78rem;
}

.notif-row {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--p-border);
  font-size: 0.82rem;
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p-gold);
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.notif-row.is-read .notif-dot {
  background: var(--p-border);
}

.bottom-nav {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.15rem;
  padding: 0.35rem 0.25rem 0.5rem;
  background: var(--p-surface);
  border-top: 1px solid var(--p-border);
  overflow-x: auto;
  scrollbar-width: none;
}

.bottom-nav::-webkit-scrollbar {
  display: none;
}

.nav-btn {
  flex: 1 0 auto;
  min-width: 52px;
  border: none;
  background: transparent;
  color: var(--p-muted);
  font-family: inherit;
  font-size: 0.58rem;
  padding: 0.25rem 0.15rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  border-radius: 10px;
}

.nav-btn span.ico {
  font-size: 1rem;
  line-height: 1;
}

.nav-btn.is-active {
  color: var(--p-gold);
  background: var(--p-gold-dim);
}

.tech-strip {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--p-muted);
  max-width: 400px;
}

.tech-strip code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.7rem;
}

#toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  max-width: min(90vw, 340px);
  padding: 0.75rem 1rem;
  background: rgba(26, 36, 50, 0.96);
  border: 1px solid var(--p-border);
  border-radius: 12px;
  font-size: 0.82rem;
  text-align: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 400px) {
  .phone-shell {
    border-radius: 32px;
    padding: 10px;
  }

  .phone-inner {
    border-radius: 26px;
  }
}
