:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --border: #e6e2d8;
  --text: #2b2a27;
  --text-muted: #74716a;
  --accent: #1f7a6c;
  --accent-dark: #145c51;
  --accent-soft: #e4f2ee;
  --warn: #b4552d;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-dark);
  padding: 0 12px 2px;
}

.sidebar-logo span { color: var(--warn); }

.sidebar-tagline {
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 12px 20px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.nav-link:hover { background: var(--accent-soft); color: var(--accent-dark); }

.nav-link.active {
  background: var(--accent);
  color: white;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-lang {
  display: flex;
  gap: 4px;
  padding: 0 12px 16px;
}

.lang-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.lang-btn:hover { border-color: var(--accent); color: var(--accent-dark); }

.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.content {
  flex: 1;
  padding: 32px 40px;
  max-width: 900px;
}

h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }

.page-subtitle {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.card-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-box .num { font-size: 24px; font-weight: 700; color: var(--accent-dark); }
.stat-box .label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  object-fit: cover;
}

.avatar-sm { width: 36px; height: 36px; font-size: 13px; }
.avatar-md { width: 56px; height: 56px; font-size: 18px; }
.avatar-lg { width: 96px; height: 96px; font-size: 32px; }

.user-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 10px;
  transition: 0.15s;
}

.user-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }

.user-card .name { font-weight: 600; font-size: 15px; }
.meta { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-dark);
  margin: 2px 4px 2px 0;
}

.has-tooltip { cursor: pointer; }

.trust-badge,
.chain-badge,
.telegram-verified-badge {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 8px;
}

.trust-badge.has-tooltip svg,
.chain-badge.has-tooltip svg,
.telegram-verified-badge.has-tooltip svg {
  outline: 1px dotted var(--text-muted);
  outline-offset: 2px;
  border-radius: 50%;
}

.trust-badge svg { fill: #2f6fed; }
.chain-badge svg { stroke: #c9a227; }

.tap-tooltip {
  position: fixed;
  z-index: 1000;
  background: var(--text);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  max-width: 240px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.connector-levels {
  display: flex;
  gap: 20px;
}

.connector-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.5;
}

.connector-level.achieved { opacity: 1; }

.connector-level span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  border-bottom: 1px dotted currentColor;
}

.connector-level.achieved span { color: var(--text); }

.pwa-steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pwa-steps li {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.badge.outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge.warn { background: #f7e6db; color: var(--warn); }

.notice-info {
  background: #e4edfb;
  border: 1px solid #2f6fed;
  color: #1f4fb0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin: 14px 0;
}

.message-unread-badge {
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px;
}

.chat-bubble-row { display: flex; }
.chat-bubble-row.mine { justify-content: flex-end; }
.chat-bubble-row.theirs { justify-content: flex-start; }

.chat-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
}

.chat-bubble-row.mine .chat-bubble {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-bubble-row.theirs .chat-bubble {
  background: var(--accent-soft);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-bubble-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-time {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
  text-align: right;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
  color: var(--text-muted);
}

input[type=text], input[type=email], input[type=tel], input[type=password], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

textarea { resize: vertical; min-height: 70px; }

input.input-error, select.input-error, textarea.input-error {
  border-color: var(--warn);
  box-shadow: 0 0 0 1px var(--warn);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 6px 8px;
  color: var(--text-muted);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.checkbox-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  background: var(--surface);
}

.checkbox-chip.checked {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Search page's filter chip groups — tighter than the default
   .checkbox-group everywhere else (forms elsewhere still use the base gap). */
.search-filter-chips {
  gap: 6px;
  margin-top: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: white;
}

.btn:hover { background: var(--accent-dark); }

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.secondary:hover { background: var(--accent-soft); border-color: var(--accent); }

.btn:disabled, .btn:disabled:hover {
  cursor: default;
  opacity: 0.55;
  background: var(--surface);
  color: var(--text-muted);
  border-color: var(--border);
}

.form-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.relationship-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.relationship-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  flex-shrink: 1;
}

.relationship-text .badge { flex-shrink: 0; margin: 0; }

.relationship-comment {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  margin: 0;
}

.edit-relationship-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
}

.edit-relationship-icon-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.trip-row-body { flex: 1; min-width: 0; }

.trip-row-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  padding-left: 10px;
}

.delete-trip-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.delete-trip-icon-btn:hover {
  border-color: #a32424;
  background: #f6d4d4;
  color: #a32424;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.photo-slot {
  position: relative;
}

.lightbox-trigger { cursor: zoom-in; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
  padding: 24px;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 1001;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.3); }

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: 999px;
  z-index: 1001;
}

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}

.trust-chain {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.chain-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 78px;
  text-align: center;
  border-radius: 8px;
  padding: 4px;
}

.chain-node:hover { background: var(--accent-soft); }

.chain-node .name { font-size: 11px; font-weight: 600; line-height: 1.2; }

.chain-node-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.chain-node-badges .trust-badge,
.chain-node-badges .chain-badge,
.chain-node-badges .telegram-verified-badge {
  margin-left: 0;
}

.chain-edge {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
  padding-bottom: 20px;
  position: relative;
}

.chain-edge .arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  font-size: 16px;
  color: var(--accent);
}
.chain-edge .type { font-weight: 600; color: var(--accent-dark); white-space: nowrap; }

.chain-edge.has-tooltip .type { border-bottom: 1px dotted currentColor; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.field-value {
  font-size: 14px;
  margin-bottom: 2px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px;
}

.contact-link:hover {
  color: var(--accent);
}

.contact-link-arrow {
  font-size: 11px;
  opacity: 0.7;
}

.field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.code-box {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 3px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 14px 20px;
  border-radius: 8px;
  display: inline-block;
  margin: 8px 0;
}

.invite-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

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

.trip-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.trip-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 4px;
  margin-right: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.trip-tab:hover { color: var(--text); }

.trip-tab.active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.status-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-pill.pending { background: #fbe9d0; color: #8a5a12; }
.status-pill.used { background: #dcefe6; color: var(--accent-dark); }
.status-pill.expired { background: #f7e0db; color: var(--warn); }
.status-pill.unavailable { background: #e8e6e1; color: var(--text-muted); }
.status-pill.blocked { background: #f6d4d4; color: #a32424; }
.status-pill.blocked.has-tooltip { border-bottom: 1px dotted #a32424; }

.blurred {
  filter: blur(6px);
  user-select: none;
}

img.blurred { filter: blur(10px); }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--accent-dark);
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 100;
}

.upload-btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
  margin-top: 6px;
}

.upload-btn:hover { border-color: var(--accent); color: var(--accent-dark); }

.hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.skeleton { padding-top: 4px; }

.skeleton-line,
.skeleton-card {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--border) 25%, var(--accent-soft) 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

.skeleton-title { height: 26px; width: 40%; margin-bottom: 10px; }
.skeleton-subtitle { height: 14px; width: 60%; margin-bottom: 24px; }

.skeleton-card {
  height: 90px;
  margin-bottom: 20px;
  border-radius: var(--radius);
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Mobile-only nav (bottom tab bar + top settings dropdown) — hidden on
   desktop, swapped in for .sidebar-desktop below the 720px breakpoint. */
.mobile-topbar,
.mobile-settings-panel,
.mobile-bottom-nav {
  display: none;
}

/* Search page: the help-type/trust checkbox groups collapse behind a
   toggle on mobile only — always expanded on desktop. */
.advanced-filters-toggle {
  display: none;
}

@media (max-width: 720px) {
  .layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    padding: 0;
    border-right: none;
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .sidebar-desktop { display: none; }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }

  .mobile-topbar-brand {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .mobile-topbar-logo {
    font-size: 19px;
    font-weight: 700;
    color: var(--accent-dark);
  }

  .mobile-topbar-logo span { color: var(--warn); }

  .mobile-topbar-subtitle {
    font-size: 10px;
    color: var(--text-muted);
  }

  .mobile-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px;
    cursor: pointer;
  }

  .mobile-settings-panel {
    display: none;
    flex-direction: column;
    gap: 2px;
    position: fixed;
    top: 52px;
    right: 12px;
    z-index: 70;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 8px;
    min-width: 210px;
  }

  .mobile-settings-panel.open { display: flex; }

  .mobile-settings-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
  }

  .mobile-settings-link:hover { background: var(--accent-soft); }

  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 10px 4px calc(10px + env(safe-area-inset-bottom));
  }

  .mobile-nav-indicator {
    position: absolute;
    top: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 4px;
    width: calc((100% - 8px) / 5);
    background: var(--accent-soft);
    border-radius: 8px;
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.15s ease;
    z-index: 0;
  }

  .mobile-nav-item {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 1px;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 8px;
    transition: color 0.15s ease;
  }

  .mobile-nav-item .icon { position: relative; display: inline-flex; }
  .mobile-nav-item .icon svg { width: 18px; height: 18px; }

  .mobile-nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--warn);
    border: 1.5px solid var(--surface);
  }

  .mobile-nav-item.active { color: var(--accent-dark); }

  .content { padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); }

  .advanced-filters-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid var(--border);
    margin-top: 14px;
    padding: 12px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-dark);
    cursor: pointer;
  }

  .advanced-filters-toggle .chevron { display: inline-block; transition: transform 0.15s; }
  .advanced-filters-toggle.open .chevron { transform: rotate(180deg); }

  .advanced-filters { display: none; }
  .advanced-filters.open { display: block; margin-top: 10px; }

  .trip-row-status {
    order: -1;
    margin-left: 0;
    flex-basis: 100%;
    padding-left: 0;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
  }

  .search-filter-chips { gap: 4px; }
  .search-filter-chips .checkbox-chip { padding: 4px 10px; font-size: 12px; }

  .two-col { grid-template-columns: 1fr; }
  .stat-grid, .photo-grid { grid-template-columns: repeat(2, 1fr); }

  .card { padding: 16px 18px; }

  .user-card { flex-wrap: wrap; }
  .invite-history-row { flex-wrap: wrap; gap: 8px; }
  .form-actions { flex-wrap: wrap; }

  /* 16px prevents iOS Safari from auto-zooming the page on input focus */
  input[type=text], input[type=email], input[type=tel], input[type=password], textarea, select {
    font-size: 16px;
  }

  .btn { min-height: 40px; }

  .toast {
    left: 16px;
    right: 16px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    text-align: center;
  }
}

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .content { padding: 12px 12px calc(92px + env(safe-area-inset-bottom)); }
  .card { padding: 14px 16px; }
}
