*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: #94A3B8;
  background-image: linear-gradient(160deg, #1A56DB18 0%, #16A34A12 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 0 64px;
}

/* ===== PHONE SHELL ===== */
#phone-frame {
  width: var(--phone-width);
  min-height: var(--phone-height);
  background: var(--color-bg);
  border-radius: 44px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.1),
    0 2px 0 1px rgba(255,255,255,0.15) inset,
    0 32px 80px rgba(0,0,0,0.35),
    0 8px 24px rgba(0,0,0,0.2);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 11px solid #1C1C1E;
}

/* Notch / dynamic island */
#phone-frame::before {
  content: '';
  display: block;
  width: 120px;
  height: 34px;
  background: #1C1C1E;
  border-radius: 0 0 22px 22px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

/* ===== STATUS BAR ===== */
#status-bar {
  background: var(--color-surface);
  height: var(--status-height);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 28px 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.status-time {
  font-size: 15px;
  font-weight: var(--font-semibold);
  letter-spacing: -0.5px;
  color: var(--gray-900);
}

.status-icons {
  display: flex;
  gap: 5px;
  align-items: center;
  color: var(--gray-900);
}

.status-icons svg {
  width: 16px;
  height: 16px;
}

/* ===== APP CONTAINER ===== */
#app {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  display: flex;
  flex-direction: column;
}

#app::-webkit-scrollbar { display: none; }
#app { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== SCREEN ===== */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  min-height: 100%;
  animation: screenIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes screenIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes screenBack {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen.animate-back { animation: screenBack 0.2s ease-out; }

/* ===== BASE ELEMENTS ===== */
img { max-width: 100%; height: auto; display: block; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-family);
  outline: none;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

input, textarea, select {
  font-family: var(--font-family);
  font-size: var(--text-base);
  outline: none;
}

/* ===== MOBILE NATIVE (no phone frame on real devices) ===== */
@media (max-width: 450px) {
  body {
    background: var(--color-bg);
    padding: 0;
    display: block;
  }

  #phone-frame {
    width: 100%;
    min-height: 100svh;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }

  #phone-frame::before {
    display: none;
  }

  #status-bar {
    display: none;
  }

  #app {
    padding-top: env(safe-area-inset-top, 20px);
  }
}

/* ===== UTILITIES ===== */
.hidden        { display: none !important; }
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-center{ justify-content: center; }
.justify-between{ justify-content: space-between; }
.gap-2         { gap: var(--space-2); }
.gap-3         { gap: var(--space-3); }
.gap-4         { gap: var(--space-4); }
.text-center   { text-align: center; }
.w-full        { width: 100%; }
.flex-1        { flex: 1; }
.mt-2          { margin-top: var(--space-2); }
.mt-3          { margin-top: var(--space-3); }
.mt-4          { margin-top: var(--space-4); }
.mb-2          { margin-bottom: var(--space-2); }
.mb-4          { margin-bottom: var(--space-4); }
.p-5           { padding: var(--space-5); }
.px-5          { padding-left: var(--space-5); padding-right: var(--space-5); }
.py-3          { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.text-sm       { font-size: var(--text-sm); }
.text-lg       { font-size: var(--text-lg); }
.text-muted    { color: var(--color-text-secondary); }
.font-medium   { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold     { font-weight: var(--font-bold); }
.rounded-full  { border-radius: var(--radius-full); }
