:root {
  --navy: #1a2744;
  --slate: #4a5f7a;
  --teal: #5ba8a8;
  --teal-soft: #e8f4f4;
  --gold: #c9a962;
  --bg: #f7f8fa;
  --card: #ffffff;
  --text: #1a2744;
  --muted: #6b7a8f;
  --border: #e2e6ed;
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  min-height: 100vh;
}

.screen { display: none; }
.screen.active { display: block; }

.hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.logo {
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.tagline {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0.75rem 0 0.5rem;
}

.sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.35rem 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
  box-shadow: 0 1px 4px rgba(26, 39, 68, 0.05);
}

.card h2, .card h3 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  color: var(--navy);
}

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.65rem;
  font-family: inherit;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover { background: #243556; }

.btn-secondary {
  background: var(--teal-soft);
  color: var(--navy);
  border: 1px solid #c5dede;
}

.btn-ghost {
  background: transparent;
  color: var(--slate);
  border: 1px solid var(--border);
}

.btn-gold {
  background: linear-gradient(135deg, #d4bc7a, var(--gold));
  color: var(--navy);
}

label {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.75rem 0 0.35rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
}

textarea {
  min-height: 140px;
  resize: vertical;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

.hero-metric {
  text-align: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(160deg, var(--navy) 0%, #2a3d5c 100%);
  border-radius: var(--radius);
  color: #fff;
  margin-bottom: 1rem;
}

.hero-metric .value {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--teal);
}

.hero-metric .label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  margin-top: 0.35rem;
  opacity: 0.9;
}

.hero-metric .peace {
  font-size: 0.95rem;
  margin-top: 0.5rem;
  color: var(--gold);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.stat-pill {
  flex: 1;
  text-align: center;
  background: var(--teal-soft);
  border-radius: 12px;
  padding: 0.65rem 0.4rem;
  font-size: 0.85rem;
}

.stat-pill strong {
  display: block;
  font-size: 1.1rem;
  color: var(--navy);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--teal-soft);
  color: var(--navy);
}

.badge-gold { background: #f5ecd4; color: #6b5a2e; }

.split-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.75rem 0;
}

.split-needs { background: var(--teal); }
.split-wants { background: var(--slate); opacity: 0.5; }

.bill-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.bill-change-up { color: var(--slate); }
.bill-change-down { color: var(--teal); }

.notice {
  background: var(--teal-soft);
  border: 1px solid #c5dede;
  border-radius: 12px;
  padding: 0.85rem;
  font-size: 0.9rem;
  color: var(--navy);
  margin: 0.75rem 0;
}

.notice strong { display: block; margin-bottom: 0.35rem; }

.small { font-size: 0.85rem; color: var(--muted); }

.merchant-review {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  margin: 0.65rem 0;
}

footer.site {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.82rem;
  color: var(--muted);
}

footer.site a { color: var(--teal); }

.hidden { display: none !important; }

input[type="file"] { font-size: 0.88rem; }

@media (min-width: 500px) {
  .app { padding-top: 2rem; }
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.tag-chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--slate);
}

.tag-chip.active {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--navy);
}

.tag-chip-custom {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.tx-tag-row {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
  font-size: 0.88rem;
}

.tx-tag-row:last-child { border-bottom: none; }

.couples-bar {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.couples-bar button {
  flex: 1;
  min-width: 70px;
  margin-top: 0;
  padding: 0.5rem;
  font-size: 0.85rem;
}

.couples-bar button.active {
  background: var(--navy);
  color: #fff;
}

.footer-links {
  margin: 0.35rem 0;
  line-height: 1.8;
}

.footer-links a {
  color: var(--teal);
  text-decoration: none;
  margin: 0 0.35rem;
}

.footer-links a:hover { text-decoration: underline; }

.legal-doc { max-width: 720px; margin: 0 auto; }
.legal-doc h1 { font-size: 1.5rem; color: var(--navy); }
.legal-doc h2 { font-size: 1.05rem; margin-top: 1.5rem; color: var(--navy); }
.legal-doc p, .legal-doc li { color: var(--muted); font-size: 0.95rem; }

.trial-copy { color: var(--muted); }

.gate-error {
  color: #b42318;
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.access-key-card h3 { margin-top: 0; }

.access-key-box {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.78rem;
  word-break: break-all;
  background: var(--teal-soft);
  border: 1px solid var(--teal);
  border-radius: 10px;
  padding: 0.85rem;
  margin: 0.75rem 0;
  color: var(--navy);
}
