/* Open Loops — premium minimal. Mobile-first, system fonts, generous whitespace. */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e8e8e8;
  --accent: #111111;
  --high: #b91c1c;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: rgba(250,250,250,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: -.02em; font-size: 17px; }
.topbar-right { display: flex; gap: 8px; }

.wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px 80px; }

.hero { padding: 56px 8px; text-align: center; }
.hero h1 { font-size: 40px; letter-spacing: -.03em; line-height: 1.1; margin: 0 0 16px; }
.lede { color: var(--muted); font-size: 18px; max-width: 44ch; margin: 0 auto 28px; }
.fine { color: var(--muted); font-size: 13px; margin-top: 20px; }

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: 999px; padding: 9px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.big { font-size: 16px; padding: 14px 28px; text-decoration: none; display: inline-block; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  border: none; background: none; padding: 12px 14px; font-size: 15px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.pill {
  display: inline-block; min-width: 22px; text-align: center;
  background: var(--ink); color: #fff; border-radius: 999px;
  font-size: 12px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px;
}

.syncstate { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

.looplist { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px;
}
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.tag {
  flex-shrink: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; color: var(--muted);
}
.tag.high { color: var(--high); border-color: var(--high); }
.why { color: var(--ink); margin: 8px 0 4px; font-size: 15px; }
.evidence {
  color: var(--muted); font-size: 13.5px; font-style: italic;
  border-left: 2px solid var(--line); padding-left: 10px; margin: 8px 0;
}
.meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.actions { display: flex; gap: 8px; }
.actions .btn { flex: 1; }

.briefing h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.02em; }
.briefing p { margin: 0 0 8px; color: var(--ink); }
.briefing .when { color: var(--muted); font-size: 13px; }
.briefing-summary { margin: 0 0 8px; line-height: 1.55; }

.empty { text-align: center; color: var(--muted); padding: 48px 0; font-size: 17px; }

.sheet {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: flex-end; justify-content: center; z-index: 20;
}
.sheet-inner {
  background: var(--surface); width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0; padding: 20px; padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.sheet-inner h3 { margin: 0 0 12px; }
.sheet-row { display: flex; gap: 8px; margin-bottom: 12px; }
.sheet-row .btn { flex: 1; }
#sheetCancel { width: 100%; }

/* ---- Landing page (logged-out view) ------------------------------------ */
html { scroll-behavior: smooth; }

.kicker {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px;
  margin: 0 0 20px;
}

.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.cta-row .btn { text-decoration: none; }

.benefits { display: grid; gap: 12px; margin: 56px 0; }
.benefit {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.benefit-icon { font-size: 26px; margin-bottom: 10px; }
.benefit h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.01em; }
.benefit p { margin: 0; color: var(--muted); font-size: 15px; }
@media (min-width: 640px) {
  .benefits { grid-template-columns: repeat(3, 1fr); }
}

.how { margin: 56px 0; }
.how h2, .waitlist h2 {
  font-size: 24px; letter-spacing: -.02em; margin: 0 0 20px; text-align: center;
}
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: step; }
.steps li {
  counter-increment: step; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 16px 60px;
  position: relative;
}
.steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 16px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps strong { display: block; margin-bottom: 4px; font-size: 16px; }
.steps span { color: var(--muted); font-size: 15px; }

.waitlist {
  margin: 56px 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; padding: 32px 24px;
  text-align: center; scroll-margin-top: 80px;
}
.lede-sm { color: var(--muted); font-size: 16px; margin: 0 0 24px; }
#waitlistForm { display: flex; flex-direction: column; gap: 10px; max-width: 380px; margin: 0 auto; }
#waitlistForm input {
  appearance: none; border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px; font-size: 16px; font-family: inherit;
  background: var(--bg); color: var(--ink); width: 100%;
}
#waitlistForm input:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
#waitlistForm .btn.big { width: 100%; }
.form-msg { min-height: 20px; font-size: 14px; color: var(--high); margin: 4px 0 0; }
.done-msg { font-size: 18px; margin: 12px 0; }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0 8px; }
.foot p { margin: 0; }

.topbar-right .btn { text-decoration: none; display: inline-flex; align-items: center; }
