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

:root {
  --ink: #1a1a1a;
  --gray: #6b7280;
  --gray-light: #9ca3af;
  --line: #e7e7e9;
  --bg: #ffffff;
  --green: #16a34a;
  --red: #e0322d;
}

html, body {
  background: #c8ccd2;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* Phone frame */
.phone {
  position: relative;
  width: 100%;
  max-width: 390px;
  height: 100vh;
  max-height: 844px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
@media (min-width: 430px) {
  .phone { border-radius: 44px; border: 1px solid #d8d8d8; }
}

/* Safari URL bar */
.safari-bar {
  height: 42px; flex: 0 0 42px;
  display: flex; align-items: center; padding: 0 16px;
}
.url {
  flex: 1; text-align: center; font-size: 16px; font-weight: 500;
  color: #1a1a1a; letter-spacing: -.2px;
}

/* App header */
.app-header {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.hamburger, .bell, .avatar-btn {
  background: none; border: none; cursor: pointer; color: var(--ink);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.hamburger svg { width: 22px; height: 22px; }
.brand { font-size: 16px; font-weight: 600; }
.tab-select {
  max-width: 150px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font-size: 14px; cursor: pointer; color: var(--ink);
}
.tab-select svg { width: 16px; height: 16px; color: var(--gray); flex: 0 0 16px; }
.bell { margin-left: auto; }
.bell svg { width: 22px; height: 22px; }
.avatar-btn img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
  border: 1.5px solid #fff;
}

/* App body */
.app-body {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.app-body::-webkit-scrollbar { width: 0; }

/* Stats grid */
.stats {
  padding: 18px 20px 8px;
  display: grid; grid-template-columns: 1fr 1fr; row-gap: 18px; column-gap: 12px;
  border-bottom: 1px solid var(--line);
}
.stat-label {
  font-size: 13px; color: var(--gray); display: flex; align-items: center; gap: 5px;
  margin-bottom: 4px;
}
.stat-label .i {
  width: 14px; height: 14px; border: 1px solid var(--gray-light); border-radius: 50%;
  font-size: 9px; color: var(--gray-light); display: inline-flex;
  align-items: center; justify-content: center; font-style: italic; font-weight: 600;
}
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }

/* Opportunities */
.section-title { font-size: 20px; font-weight: 700; padding: 22px 20px 6px; }

.card {
  margin: 12px 16px; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; background: #fff;
}
.card-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.card-title {
  font-size: 15px; font-weight: 700; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-price { font-size: 14px; font-weight: 600; flex: 0 0 auto; }
.card-desc { font-size: 14px; color: #3f3f46; line-height: 1.45; margin-top: 7px; }
.card-meta { font-size: 13px; color: var(--gray); margin-top: 12px; }
.card-earn { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.avatars { display: flex; }
.avatars span {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff;
  margin-left: -8px; background-size: cover; background-position: center;
}
.avatars span:first-child { margin-left: 0; }
.earn-text { font-size: 13px; color: var(--gray); }
.btn-interest {
  margin-top: 14px; width: 100%; padding: 11px; border: 1px solid #d4d4d8;
  border-radius: 8px; background: #fff; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; color: var(--ink); transition: background .15s;
}
.btn-interest:active { background: #f4f4f5; }
.submitted {
  margin-top: 14px; display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.submitted svg { width: 16px; height: 16px; color: var(--ink); }
.btn-interest.done { color: var(--green); border-color: var(--green); }

/* Generic stacked content pages (made-up tabs) */
.page-pad { padding: 8px 16px 24px; }
.list-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.list-row .ico {
  width: 40px; height: 40px; border-radius: 10px; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center;
  background: #f1f3f5; font-size: 18px;
}
.list-row .body { flex: 1; min-width: 0; }
.list-row .t { font-size: 15px; font-weight: 600; }
.list-row .s { font-size: 13px; color: var(--gray); margin-top: 2px; }
.list-row .meta { font-size: 12px; color: var(--gray-light); flex: 0 0 auto; }
.pill {
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 10px; padding: 2px 7px;
}
.page-hd { padding: 18px 20px 4px; font-size: 22px; font-weight: 700; }
.page-sub { padding: 0 20px 10px; font-size: 14px; color: var(--gray); }

/* Safari toolbar */
.safari-toolbar {
  flex: 0 0 64px; height: 64px;
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 20px 14px; background: #f7f7f8; border-top: 1px solid #e2e2e4;
}
.safari-toolbar .tb { background: none; border: none; color: #1d6cf0; cursor: pointer; }
.safari-toolbar .tb svg { width: 24px; height: 24px; }
.safari-toolbar .tb.fwd { color: #b9c4d2; }

/* Overlays */
.overlay {
  position: absolute; inset: 0; z-index: 50; display: none;
}
.overlay.open { display: block; }
.overlay::before {
  content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.28);
}
.overlay.light::before { background: transparent; }

/* Hamburger nav sheet */
.nav-sheet {
  position: absolute; inset: 0; background: #fff;
  display: flex; flex-direction: column; padding: 14px 0 0;
}
.nav-close { align-self: flex-start; background: none; border: none; padding: 8px 18px; cursor: pointer; }
.nav-close svg { width: 22px; height: 22px; color: var(--ink); }
.nav-list { padding: 8px 22px; display: flex; flex-direction: column; }
.nav-list a {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 500; color: var(--ink);
  padding: 14px 0; text-decoration: none; cursor: pointer;
}
.nav-list a.active { font-weight: 700; }

/* Profile dropdown menu */
.profile-menu {
  position: absolute; top: 86px; right: 10px; width: 232px;
  background: #fff; border-radius: 12px; padding: 6px 0;
  box-shadow: 0 8px 30px rgba(0,0,0,.18); border: 1px solid #ececec;
  max-height: calc(100% - 110px); overflow-y: auto;
}
.profile-menu .pm-item {
  padding: 11px 16px; font-size: 15px; cursor: pointer; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.profile-menu .pm-item:active, .profile-menu .pm-item.hl { background: #f1f1f3; }
.profile-menu .pm-id {
  font-size: 13px; color: var(--gray); font-family: 'SFMono-Regular', monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-menu .pm-id svg { width: 14px; height: 14px; flex: 0 0 14px; }
.pm-sep { height: 1px; background: var(--line); margin: 6px 0; }

/* Tab (Projects) dropdown menu */
.tab-menu {
  position: absolute; top: 84px; left: 50px; width: 200px;
  background: #fff; border-radius: 10px; padding: 6px 0;
  box-shadow: 0 8px 30px rgba(0,0,0,.18); border: 1px solid #ececec;
}
.tab-menu .tm-item {
  padding: 11px 16px; font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
}
.tab-menu .tm-item:active { background: #f1f1f3; }
.tab-menu .tm-item.sel { font-weight: 600; }
.tab-menu .tm-item.sel svg { width: 16px; height: 16px; color: var(--green); }

.toast {
  position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #1a1a1a; color: #fff; font-size: 13px; padding: 9px 16px;
  border-radius: 20px; z-index: 80; opacity: 0; transition: opacity .25s;
  pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; }
