/* PAGES app styles — mobile-first */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--pl-ink);
  line-height: 1.5;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(7,7,12,.92); color: #fff; border-bottom: 1px solid var(--line);
  padding: 14px 18px; padding-top: calc(14px + env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow-2);
}
.topbar .brand { font-family: var(--font-display); font-size: 22px; letter-spacing: 3px; font-weight: 700; color: var(--accent-2); }
.topbar .who { font-size: 13px; opacity: .9; }
.topbar button { background: rgba(255,255,255,.15); color: #fff; border: none;
  border-radius: var(--r-sm); padding: 6px 12px; font-size: 13px; }

/* screens */
.screen { padding: 18px 16px 24px; }
.screen h1 { font-family: var(--font-display); font-size: 26px; margin-bottom: 4px; }
.screen .lede { color: var(--pl-ink-soft); margin-bottom: 18px; font-size: 15px; }
h2.sec { font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--pl-muted); margin: 22px 0 10px; }

/* cards */
.card {
  background: var(--pl-paper); border-radius: var(--r-md);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-1);
  border: 1px solid var(--pl-line);
}
.card.tappable { cursor: pointer; }
.card.tappable:active { transform: scale(.99); }
.card .title { font-weight: 700; font-size: 16px; margin-bottom: 2px; }
.card .meta { font-size: 13px; color: var(--pl-muted); }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* pills & status */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; background: var(--pl-line); color: var(--pl-ink-soft); }
.pill.open { background: #123524; color: var(--pl-success); }
.pill.done { background: #241a3d; color: #b79ced; }
.pill.proposed { background: #3a2a0e; color: var(--pl-warn); }
.pill.accepted { background: #123524; color: var(--pl-success); }
.pill.declined, .pill.cancelled { background: #3d1611; color: var(--pl-danger); }

/* forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--pl-ink-soft); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; padding: 12px; border-radius: var(--r-sm);
  border: 1px solid var(--pl-line); background: var(--surface-2); color: var(--text);
}
.field textarea { min-height: 88px; resize: vertical; }
.btn {
  display: block; width: 100%; padding: 14px; border: none; border-radius: var(--r-md);
  background: var(--pl-crimson); color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; margin-top: 6px;
}
.btn:active { background: var(--pl-crimson-deep); }
.btn.secondary { background: #fff; color: var(--pl-crimson); border: 1.5px solid var(--pl-crimson); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); padding: 10px; }
.hint { font-size: 0.85em; color: var(--pl-ink-soft); margin: 10px 2px 0; }
.btn.small { width: auto; display: inline-block; padding: 8px 16px; font-size: 14px; }
.btn:disabled { opacity: .5; }

/* lists */
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0;
  border-bottom: 1px solid var(--pl-line); }
.item:last-child { border-bottom: none; }
.check {
  width: 24px; height: 24px; border-radius: 50%; flex: none; margin-top: 2px;
  border: 2px solid var(--pl-muted); background: var(--surface-2); cursor: pointer;
}
.check.on { background: var(--pl-success); border-color: var(--pl-success); position: relative; }
.check.on::after { content: "✓"; color: #fff; font-size: 14px; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%,-54%); }
.item .grow { flex: 1; }
.item .t { font-weight: 600; font-size: 15px; }
.item .t.strike { text-decoration: line-through; color: var(--pl-muted); }
.item .s { font-size: 13px; color: var(--pl-muted); }

/* activity */
.ev { padding: 10px 0; border-bottom: 1px solid var(--pl-line); font-size: 14px; }
.ev:last-child { border: none; }
.ev .when { font-size: 12px; color: var(--pl-muted); }

/* empty states */
.empty { text-align: center; padding: 44px 20px; color: var(--pl-muted); }
.empty .big { font-size: 40px; margin-bottom: 10px; }
.empty p { margin-bottom: 16px; }

/* tab bar */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  background: var(--pl-paper); border-top: 1px solid var(--pl-line);
  display: flex; z-index: 10; padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: var(--pl-muted); font-size: 11px; gap: 3px;
}
.tabbar a .ic { font-size: 20px; }
.tabbar a.active { color: var(--pl-crimson); font-weight: 700; }
.tabbar a.soon { opacity: .45; }

/* invite box */
.invitebox { background: var(--surface-2); border: 1px dashed var(--pl-copper); border-radius: var(--r-md);
  padding: 14px; margin: 12px 0; font-size: 14px; word-break: break-all; }
.invitebox code { font-size: 13px; }

/* toast */
#toast {
  position: fixed; bottom: calc(var(--tabbar-h) + 18px); left: 50%; transform: translateX(-50%);
  background: var(--surface-2); color: #fff; border: 1px solid var(--line); padding: 12px 20px; border-radius: 999px;
  font-size: 14px; opacity: 0; transition: opacity .25s; z-index: 50; max-width: 90%;
  text-align: center;
}
#toast.show { opacity: 1; }

/* auth */
.authwrap { padding: 60px 24px 24px; text-align: center; }
.authwrap .mark { font-family: var(--font-display); font-size: 44px; letter-spacing: 6px;
  color: var(--pl-crimson); margin-bottom: 6px; }
.authwrap .tag { font-size: 17px; color: var(--pl-ink-soft); margin-bottom: 30px; }
.mode-note { margin-top: 18px; font-size: 12px; color: var(--pl-muted); }

@media (min-width: 600px) {
  body { background: #030308; }
  #app { box-shadow: var(--shadow-2); }
}
