/* Jenna & Tyler wedding planner */
:root {
  --bg: #f7f4ec;
  --card: #ffffff;
  --ink: #26301f;
  --muted: #757a63;
  --faint: #a2a68e;
  --line: #e6e2d3;
  --sage: #5f6f46;
  --sage-dark: #485534;
  --sage-soft: #eef0e0;
  --gold: #b9944a;
  --gold-soft: #f5ecd9;
  --teal: #5f7f7a;
  --red: #a8503f;
  --red-soft: #f6e7e3;
  --shadow: 0 2px 14px rgba(48, 58, 36, 0.09);
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit;
  font-size: 16px; /* stops iOS zoom */
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--sage);
  outline-offset: 1px;
  border-color: var(--sage);
}
textarea { min-height: 74px; resize: vertical; }
a { color: var(--sage-dark); }

/* ---------- Login ---------- */
#login { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.login-bg { position: absolute; inset: 0; background-size: cover; background-position: center 55%; }
.login-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(38,48,31,0.15) 0%, rgba(38,48,31,0.25) 45%, rgba(28,34,22,0.88) 100%);
}
.login-card {
  position: relative; width: 100%; max-width: 440px;
  padding: 22px 26px calc(30px + env(safe-area-inset-bottom));
  text-align: center; color: #fdfcf7;
}
.login-names {
  font-family: 'Cormorant Garamond', serif;
  font-size: 46px; font-weight: 600; line-height: 1.05;
  text-shadow: 0 2px 14px rgba(0,0,0,0.35);
}
.amp { color: var(--gold); font-style: italic; font-weight: 500; }
.login-date { margin-top: 6px; font-size: 15px; letter-spacing: 0.04em; }
.login-sub { margin: 2px 0 18px; font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
#pin-form { display: flex; flex-direction: column; gap: 10px; }
#pin-input {
  text-align: center; font-size: 22px; letter-spacing: 0.35em;
  background: rgba(255,255,255,0.94); border: none; padding: 12px;
}
.pin-error { margin-top: 12px; font-size: 13.5px; color: #ffd9cf; }
.tentative-chip {
  display: inline-block; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(255,255,255,0.22); border-radius: 99px; padding: 2px 8px; vertical-align: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 11px; padding: 11px 16px;
  font-size: 15px; font-weight: 600; background: var(--sage-soft); color: var(--sage-dark);
}
.btn-primary { background: var(--sage); color: #fff; }
.btn-primary:active { background: var(--sage-dark); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-wide { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13.5px; border-radius: 9px; }

/* ---------- Shell ---------- */
#shell { max-width: 800px; margin: 0 auto; padding-bottom: 110px; }
#topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 8px;
  background: linear-gradient(var(--bg) 82%, rgba(247,244,236,0));
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.monogram { font-family: 'Cormorant Garamond', serif; font-size: 27px; font-weight: 700; }
.mini-count { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.actor-chip {
  border: 1px solid var(--line); background: #fff; border-radius: 99px;
  padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--sage-dark);
  box-shadow: var(--shadow);
}
.icon-btn {
  position: relative; border: 1px solid var(--line); background: #fff;
  border-radius: 99px; width: 34px; height: 34px; font-size: 16px; line-height: 1;
  box-shadow: var(--shadow); padding: 0;
}
.icon-btn.named {
  width: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 0 12px 0 9px;
}
.chip-name { font-size: 13px; font-weight: 600; color: var(--sage-dark); white-space: nowrap; }
.badge {
  position: absolute; top: -5px; right: -6px; min-width: 17px; height: 17px;
  background: var(--red); color: #fff; border-radius: 99px; font-size: 10.5px;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ---------- sub-items ---------- */
.sub-row {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; margin-bottom: 6px; font-size: 14px;
}
.sub-row.done .sub-title { text-decoration: line-through; color: var(--faint); }
.sub-row .check { width: 20px; height: 20px; border-radius: 6px; }
.sub-row .check:checked::after { left: 5.5px; top: 2px; width: 4px; height: 9px; }
.sub-title { flex: 1; min-width: 0; cursor: pointer; overflow-wrap: anywhere; }
.sub-add { display: flex; gap: 7px; margin-top: 4px; }
.sub-add input { padding: 8px 10px; font-size: 15px; }

/* ---------- mini hero (the couple, on every page) ---------- */
.mini-hero {
  position: relative; display: flex; align-items: center; gap: 12px;
  border-radius: 14px; overflow: hidden; margin: 2px 0 14px;
  border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer;
  background: var(--card);
}
.mini-hero img { width: 86px; height: 64px; object-fit: cover; object-position: center 62%; display: block; flex: 0 0 86px; }
.mini-hero-text { display: flex; flex-direction: column; padding: 6px 12px 6px 0; min-width: 0; }
.mini-hero-names { font-family: 'Cormorant Garamond', serif; font-size: 19px; font-weight: 700; line-height: 1.1; }
.mini-hero-date { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; }

/* ---------- lightbox ---------- */
#lightbox {
  position: fixed; inset: 0; z-index: 70; background: rgba(15, 18, 11, 0.93);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
#lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }

#nav {
  position: sticky; top: 0; z-index: 19;
  padding: 46px 16px 10px; margin-top: -44px;
  background: linear-gradient(var(--bg) 75%, rgba(247,244,236,0));
  pointer-events: none;
}
#nav .pill {
  pointer-events: auto;
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 99px; padding: 8px 14px; font-size: 13.5px; font-weight: 600;
}
#nav .pill.on { background: var(--sage); border-color: var(--sage); color: #fff; }

/* Desktop: every tab, full width, wrapping onto more rows when needed */
.nav-desktop { display: flex; flex-wrap: wrap; gap: 7px; }
.nav-mobile { display: none; }

/* Mobile: hamburger that drops the menu down in place */
@media (max-width: 699px) {
  .nav-desktop { display: none; }
  .nav-mobile { display: block; position: relative; pointer-events: auto; }
  .nav-burger { width: 100%; text-align: left; }
  .nav-drop {
    display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px);
    background: var(--card); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 10px 30px rgba(48,58,36,0.18); overflow: hidden; z-index: 30;
  }
  .nav-drop.open { display: block; max-height: 70vh; overflow-y: auto; }
  .nav-drop-item {
    display: block; width: 100%; text-align: left; background: none; border: none;
    border-bottom: 1px solid var(--line); padding: 13px 16px;
    font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer;
  }
  .nav-drop-item:last-child { border-bottom: none; }
  .nav-drop-item.on { background: var(--sage-soft); color: var(--sage-dark); }
}

/* member tag toggles */
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tagbtn {
  border: 1.5px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 99px; padding: 7px 13px; font-size: 13.5px; font-weight: 600;
  font-family: inherit; cursor: pointer;
}
.tagbtn.on { background: var(--sage); border-color: var(--sage); color: #fff; }

#app { padding: 10px 16px 30px; }

.fab {
  position: fixed; right: 18px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 21;
  width: 58px; height: 58px; border-radius: 50%; border: none;
  background: var(--sage); color: #fff; font-size: 30px; line-height: 1;
  box-shadow: 0 6px 18px rgba(48,58,36,0.3);
}
.fab:active { background: var(--sage-dark); }

/* ---------- Cards & rows ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 15px 16px; margin-bottom: 13px;
}
.section-title {
  font-family: 'Cormorant Garamond', serif; font-size: 23px; font-weight: 700;
  margin: 20px 2px 10px;
}
.section-sub { font-size: 13px; color: var(--muted); margin: -7px 2px 10px; }
.bucket-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--faint); margin: 18px 2px 7px;
}
.row {
  display: flex; align-items: center; gap: 11px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.row.done .row-title { text-decoration: line-through; color: var(--faint); }
.row-main { flex: 1; min-width: 0; cursor: pointer; }
.row-title { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.row-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.row-price { font-weight: 700; font-size: 14px; white-space: nowrap; }
.row-thumb {
  width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex: 0 0 46px;
  background: var(--sage-soft); display: flex; align-items: center; justify-content: center;
  font-size: 20px; border: 1px solid var(--line);
}
img.row-thumb { border: none; }

.check {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto;
  width: 24px; height: 24px; border: 2px solid var(--line); border-radius: 8px;
  background: #fff; display: inline-block; position: relative; cursor: pointer; padding: 0;
}
.check:checked { background: var(--sage); border-color: var(--sage); }
.check:checked::after {
  content: ''; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}

.star {
  flex: 0 0 auto; background: none; border: none; font-size: 20px; line-height: 1;
  color: #d8d4c3; padding: 3px;
}
.star.on { color: var(--gold); }

.chip {
  display: inline-block; font-size: 11px; font-weight: 600; border-radius: 99px;
  padding: 2px 8px; background: var(--sage-soft); color: var(--sage-dark); margin-right: 5px;
}
.chip.gold { background: var(--gold-soft); color: #8a6c2e; }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.plain { background: #efede4; color: var(--muted); }

.filter-bar { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar .pill {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 99px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.filter-bar .pill.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.empty { text-align: center; color: var(--faint); padding: 28px 10px; font-size: 14px; }

/* ---------- Home ---------- */
.hero { position: relative; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 14px; }
.hero img { width: 100%; height: 360px; object-fit: cover; object-position: center 62%; display: block; }
.hero-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 18px; color: #fdfcf7;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(28,34,22,0.75) 100%);
}
.hero-names { font-family: 'Cormorant Garamond', serif; font-size: 34px; font-weight: 600; line-height: 1; }
.hero-date { font-size: 14px; margin-top: 4px; }

.countdown { text-align: center; padding: 18px 16px 16px; }
.cd-days { font-family: 'Cormorant Garamond', serif; font-size: 56px; font-weight: 700; line-height: 1; color: var(--sage-dark); }
.cd-days-label { font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.cd-clock { display: flex; justify-content: center; gap: 18px; margin-top: 13px; }
.cd-unit { text-align: center; }
.cd-num { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cd-lab { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 13px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; box-shadow: var(--shadow); cursor: pointer; }
.stat-num { font-size: 21px; font-weight: 700; }
.stat-lab { font-size: 12px; color: var(--muted); margin-top: 1px; }

.budget-bar-wrap { background: #edeadd; border-radius: 99px; height: 12px; overflow: hidden; margin-top: 9px; }
.budget-bar { height: 100%; background: var(--sage); border-radius: 99px; transition: width 0.4s; }
.budget-bar.over { background: var(--red); }
.budget-line { display: flex; justify-content: space-between; align-items: baseline; }
.budget-big { font-size: 22px; font-weight: 700; }
.budget-small { font-size: 12.5px; color: var(--muted); }

/* ---------- Lodging ---------- */
.cap-bar-wrap { background: #edeadd; border-radius: 99px; height: 8px; overflow: hidden; margin-top: 8px; }
.cap-bar { height: 100%; background: var(--teal); border-radius: 99px; }
.cap-bar.full { background: var(--gold); }

/* ---------- Budget table ---------- */
.btable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.btable th { text-align: left; font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); padding: 4px 6px; }
.btable td { padding: 7px 6px; border-top: 1px solid var(--line); }
.btable td.num, .btable th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Modal ---------- */
#modal-root:not(:empty) {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(30, 36, 22, 0.45);
}
.modal {
  background: var(--bg); width: 100%; max-width: 560px;
  border-radius: 20px 20px 0 0; max-height: 90dvh; overflow-y: auto;
  padding: 16px 18px calc(22px + env(safe-area-inset-bottom));
  animation: slideup 0.22s ease;
}
@keyframes slideup { from { transform: translateY(40px); opacity: 0.5; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.modal-title { font-family: 'Cormorant Garamond', serif; font-size: 25px; font-weight: 700; }
.modal-head-actions { display: flex; align-items: center; gap: 4px; }
.modal-close { background: none; border: none; font-size: 24px; color: var(--muted); padding: 4px 8px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
.photo-drop {
  display: flex; align-items: center; gap: 12px;
}
.photo-preview {
  width: 74px; height: 74px; border-radius: 12px; object-fit: cover;
  background: var(--sage-soft); border: 1px dashed var(--faint);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
img.photo-preview { border-style: solid; border-color: var(--line); }

/* ---------- Toast ---------- */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px;
  background: var(--ink); color: #f5f3ea; border-radius: 12px; padding: 11px 16px;
  font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,0.25); max-width: 92vw;
}
.toast button { background: none; border: none; color: var(--gold); font-weight: 700; font-size: 14px; }

/* ---------- Desktop ---------- */
@media (min-width: 700px) {
  body { font-size: 15.5px; }
  #modal-root:not(:empty) { align-items: center; padding: 20px; }
  .modal { border-radius: 20px; }
  .hero img { height: 470px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
