/* ── MANGO AIR ──
   App-specific primitives only. Everything mangonese.css already provides —
   .btn and its variants, .card, .container, inputs, the type scale, the
   data-theme mechanism — is used as-is and never redefined here. */

/* ── LAYOUT ── */
#app {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) calc(var(--space-12) + 64px);
  padding-top: max(var(--space-5), env(safe-area-inset-top));
}

/* ── TEXT UTILITIES (not in mangonese.css) ── */
.muted { color: var(--text-secondary); }
.small { font-size: 13px; }

/* ── SMALL BUTTON ──
   Narrower than .btn, but never shorter: 44px is the floor for a touch
   target, and a "small" button is still a thing a thumb has to hit. */
.btn-sm {
  height: 44px;
  padding: 0 var(--space-3);
  font-size: 14px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-sm:hover { background: var(--border-subtle); }

.btn-danger-outline {
  background: transparent;
  color: var(--error);
  border: 1px solid var(--error);
}
.btn-danger-outline:hover { background: var(--error); color: #fff; }

/* ── OFFLINE BANNER ── */
.banner {
  padding: var(--space-2) var(--space-4);
  background: var(--warning);
  color: #1a1208;
  font-size: 14px;
  text-align: center;
}
.banner[hidden] { display: none; }

/* ── TOAST ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  transform: translate(-50%, calc(100% + var(--space-8)));
  max-width: min(90vw, 420px);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: transform var(--transition-base), opacity var(--transition-base);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-warn  { border-color: var(--warning); }
.toast-error { border-color: var(--error); }

/* ── SKELETON ──
   Shaped like the real content so nothing jumps when data lands. */
.skeleton-wrap { display: flex; flex-direction: column; gap: var(--space-3); }
.skeleton-card {
  height: 76px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    90deg,
    var(--bg-surface) 25%,
    var(--bg-elevated) 50%,
    var(--bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-sweep 1.4s var(--ease) infinite;
}
@keyframes skeleton-sweep {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── EMPTY / ERROR STATES ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-5);
  text-align: center;
}
.empty-state h2 { font-size: 18px; margin: 0; }
.empty-state p { margin: 0; max-width: 40ch; }
.error-state { border: 1px solid var(--error); border-radius: var(--radius-md); }

/* ── SIGN IN ── */
.signin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-12) var(--space-4);
  text-align: center;
  min-height: 70vh;
  justify-content: center;
}
.signin h1 { margin: 0; }
.signin p { margin: 0; max-width: 34ch; }

/* ── SETTINGS ── */
.settings { display: flex; flex-direction: column; gap: var(--space-6); }
.settings h1 { margin: 0; }
.settings-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.settings-section h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 44px;
}
.settings-label { color: var(--text-secondary); font-size: 15px; flex-shrink: 0; }

.uid-row { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.uid {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 15ch;
  user-select: all;
  -webkit-user-select: all;
}

/* ── TAB BAR ── */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 50;
}
.tab {
  flex: 1;
  min-height: 56px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.tab[aria-current="page"] { color: var(--mango); }

/* ── MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
