/* ============================================================================
   style.css  —  "Little Black Book" boutique identity
   ----------------------------------------------------------------------------
   Blush paper, wine ink, one Juicy magenta, antique-gold hairlines.
   Fashion serif (Bodoni) + tracked Futura labels + humanist body (Avenir).
   All fonts are built into the iPhone, so it works offline with no downloads.
   Every color lives in :root — change one line to re-tint the whole app.
   ============================================================================ */

:root {
  --paper:    #f6e6ea;   /* blush paper ground */
  --surface:  #ffffff;   /* cards */
  --ink:      #3b1222;   /* deep wine — primary text */
  --ink-2:    #6e3b50;   /* secondary text */
  --muted:    #8a5a6c;   /* small labels / meta */
  --magenta:  #c51e6a;   /* the one accent */
  --magenta-d:#a5155a;
  --gold:     #b18a3d;   /* antique gold hairlines + crest */
  --gold-2:   #d8b968;
  --line:     #ecd6dd;   /* soft hairline on white */
  --line-2:   #e3c9d1;

  --display: "Bodoni 72", "Didot", "Hoefler Text", Georgia, serif;
  --label:   "Futura", "Avenir Next Condensed", "Helvetica Neue", sans-serif;
  --body:    "Avenir Next", "Avenir", -apple-system, system-ui, sans-serif;

  --shadow: 0 1px 2px rgba(59,18,34,.05), 0 8px 24px rgba(59,18,34,.06);
}

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

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

/* small helper for the Futura tracked-caps look */
.eyebrow, .filterLabel, .tab, .chip, .badge, .status, .link, .count, .ghostBtn, .copyBtn, .tags .tag {
  font-family: var(--label);
}

/* ===== Masthead ========================================================== */
.masthead {
  text-align: center;
  padding: calc(22px + env(safe-area-inset-top)) 24px 18px;
  color: var(--gold);
}
.crest { width: 46px; height: 33px; color: var(--gold); display: inline-block; }
.masthead .rule {
  height: 1px;
  margin: 12px auto;
  max-width: 260px;
  background: linear-gradient(90deg, transparent, var(--gold) 18%, var(--gold-2) 50%, var(--gold) 82%, transparent);
  opacity: .8;
}
.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  letter-spacing: .5px;
  color: var(--ink);
  margin: 2px 0 0;
}
.eyebrow {
  margin: 10px 0 0;
  font-size: 10.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* ===== Sticky controls =================================================== */
.controls {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px 18px 0;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}

.searchRow { display: flex; align-items: center; gap: 10px; }
.searchIcon {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
  margin-right: -4px;
}
#search {
  flex: 1;
  font-family: var(--body);
  font-size: 16px;             /* 16px keeps iOS from zooming on focus */
  padding: 9px 2px;
  border: none;
  border-bottom: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink);
  outline: none;
}
#search::placeholder { color: var(--muted); opacity: .8; }
#search:focus { border-bottom-color: var(--magenta); }

.ghostBtn {
  flex: 0 0 auto;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-2);
  background: none;
  border: none;
  padding: 8px 2px;
  cursor: pointer;
}
.ghostBtn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
#refreshBtn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Section nav — magazine-style underline, not pills */
.tabs {
  display: flex;
  gap: 22px;
  margin-top: 6px;
  border-bottom: 1px solid var(--line-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  padding: 12px 0 13px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.tab.on { color: var(--ink); border-bottom-color: var(--magenta); }
.count {
  font-size: 10px;
  color: var(--magenta);
  margin-left: 5px;
  letter-spacing: 0;
  vertical-align: super;
}

/* ===== Filters =========================================================== */
.filters { max-width: 680px; margin: 0 auto; padding: 0 18px; }
.filters summary {
  font-family: var(--label);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  padding: 14px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after {
  content: ""; width: 6px; height: 6px; margin-top: -2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .2s ease;
}
.filters[open] summary::after { transform: rotate(-135deg); margin-top: 2px; }
.filtersBody { padding-bottom: 8px; }

.filterGroup { margin: 4px 0 12px; }
.filterLabel {
  display: block;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 9px; font-weight: 600;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .12s ease;
}
.chip:active { transform: scale(.96); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Understated iOS switches */
.toggles { display: flex; flex-direction: column; gap: 13px; margin: 16px 0 6px; }
.toggle { display: flex; align-items: center; gap: 13px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.track {
  position: relative; width: 46px; height: 27px; border-radius: 999px;
  background: var(--line-2); transition: background .2s ease; flex: 0 0 auto;
}
.knob {
  position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.toggle input:checked + .track { background: var(--magenta); }
.toggle input:checked + .track .knob { transform: translateX(19px); }
.toggleText { font-family: var(--body); font-weight: 500; font-size: 15px; color: var(--ink); }
.ageNote { font-family: var(--body); font-size: 12.5px; color: var(--muted); margin: 8px 0 2px; }

/* ===== List & cards ====================================================== */
.list {
  max-width: 680px; margin: 0 auto;
  padding: 6px 18px 40px;
  display: flex; flex-direction: column; gap: 0;
}
.status {
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  padding: 16px 2px 12px;
}
.empty {
  font-family: var(--body);
  text-align: center; color: var(--muted); padding: 48px 20px; font-size: 15px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 15px;
  margin-bottom: 13px;
  box-shadow: var(--shadow);
  animation: rise .3s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.card-top { display: flex; align-items: flex-start; gap: 12px; }
.card-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.18;
  margin: 0; flex: 1;
  color: var(--ink);
  letter-spacing: .1px;
}
.heart {
  flex: 0 0 auto; border: none; background: none; cursor: pointer; padding: 2px;
  width: 26px; height: 26px; color: var(--muted);
  transition: transform .15s ease, color .15s ease;
}
.heart svg { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; }
.heart.on { color: var(--magenta); }
.heart.on svg { fill: var(--magenta); }
.heart:active { transform: scale(1.3); }

.when {
  display: block; margin-top: 8px;
  font-family: var(--label);
  font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  color: var(--magenta);
}
.cardWhere { font-family: var(--label); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 5px; }
.blurb { font-family: var(--body); margin: 9px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }

/* meta line: small caps separated by hairline dots */
.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 13px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.badge {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
  color: var(--muted);
}
.badge.area { color: var(--ink-2); }
.badge.budget { color: var(--gold); }
.badge.age21 { color: var(--ink); border: 1px solid var(--gold); padding: 2px 6px; border-radius: 3px; letter-spacing: .1em; }
.badge.live { color: var(--magenta); }
.badge + .badge::before {
  content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%;
  background: var(--line-2); margin-right: 8px; vertical-align: middle;
}

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.tag {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px;
}

.links { display: flex; gap: 20px; margin-top: 13px; }
.link {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  color: var(--magenta); text-decoration: none;
  border-bottom: 1px solid transparent; padding-bottom: 1px;
}
.link:active { border-bottom-color: var(--magenta); }

/* Copy-my-list button (saved tab) */
.copyBtn {
  align-self: flex-start;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700;
  color: var(--ink); background: transparent;
  border: 1px solid var(--gold); border-radius: 999px;
  padding: 11px 20px; margin: 4px 0 14px; cursor: pointer;
  transition: all .15s ease;
}
.copyBtn:active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ===== Toast ============================================================= */
.toast {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  background: var(--ink); color: var(--paper);
  font-family: var(--label);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  padding: 12px 22px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(59,18,34,.28);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================================
   THEMES  —  she picks one in Settings. :root above is the default ("Black Book").
   Each block just re-tints the same variables. To add a theme: copy a block,
   rename the data-theme, change the colors, and add it to THEMES in js/themes.js.
   ============================================================================ */
:root[data-theme="juicy"] {
  --paper:#fff0f6; --surface:#ffffff; --ink:#7a1348; --ink-2:#b23a7a; --muted:#c76a99;
  --magenta:#ff2d8e; --magenta-d:#e01277; --gold:#e2ad3f; --gold-2:#f3d477;
  --line:#ffd9ea; --line-2:#ffc4de;
}
:root[data-theme="noir"] {
  --paper:#141017; --surface:#201a26; --ink:#f3e9ef; --ink-2:#c9b6c4; --muted:#9a8798;
  --magenta:#ff5aa0; --magenta-d:#ff3d8f; --gold:#d8b968; --gold-2:#ecd28a;
  --line:#302838; --line-2:#574a63;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.45);
}
:root[data-theme="coquette"] {
  --paper:#f7f0ea; --surface:#fffdfb; --ink:#6b3a3f; --ink-2:#9c6167; --muted:#b98a8f;
  --magenta:#d96a86; --magenta-d:#c2506e; --gold:#c7ab84; --gold-2:#e4cfa9;
  --line:#efe2dc; --line-2:#e6d3cc;
}
:root[data-theme="riviera"] {
  --paper:#e9f4f3; --surface:#ffffff; --ink:#143f42; --ink-2:#386a6c; --muted:#6d9695;
  --magenta:#e8578a; --magenta-d:#d33d76; --gold:#c9a24a; --gold-2:#e0c274;
  --line:#d7e8e6; --line-2:#c4ddda;
}

/* ============================================================================
   OVERLAYS  —  detail view, settings, and tutorial all share this bottom sheet.
   ============================================================================ */
.backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20, 8, 14, .42);
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.backdrop.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81;
  max-width: 680px; margin: 0 auto;
  max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--paper);
  border-top-left-radius: 22px; border-top-right-radius: 22px;
  box-shadow: 0 -12px 40px rgba(20,8,14,.28);
  padding: 10px 22px calc(30px + env(safe-area-inset-bottom));
  transform: translateY(102%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.sheet.show { transform: translateY(0); }
.sheet .grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line-2); margin: 4px auto 6px; }
.sheet .sheetClose {
  position: sticky; top: 0; float: right;
  font-family: var(--label); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  color: var(--muted); background: none; border: none; cursor: pointer; padding: 6px 0 6px 10px;
}

/* ---- Detail view ---- */
.detail .dEyebrow { font-family: var(--label); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--magenta); font-weight: 700; margin: 6px 0 0; }
.detail .dName { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.1; color: var(--ink); margin: 8px 0 0; }
.detail .dWhen { font-family: var(--label); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--magenta); font-weight: 700; margin: 12px 0 0; }
.detail .dRow { display: flex; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.detail .dRow .k { font-family: var(--label); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; flex: 0 0 84px; padding-top: 2px; }
.detail .dRow .v { font-family: var(--body); font-size: 15px; line-height: 1.5; color: var(--ink); flex: 1; }
.detail .dDesc { font-family: var(--body); font-size: 15.5px; line-height: 1.6; color: var(--ink-2); margin: 16px 0 0; }
.detail .dTags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.detail .dActions { display: flex; gap: 10px; margin-top: 22px; }
.detail .dBtn {
  flex: 1; text-align: center; text-decoration: none;
  font-family: var(--label); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  padding: 14px 10px; border-radius: 12px; cursor: pointer; border: 1px solid var(--ink);
  color: var(--paper); background: var(--ink);
}
.detail .dBtn.ghost { color: var(--ink); background: transparent; }
.detail .dBtn.save.on { background: var(--magenta); border-color: var(--magenta); color: #fff; }

/* ---- Settings ---- */
.settings .sTitle, .tut .tTitleBar { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--ink); margin: 6px 0 2px; }
.settings .sLabel { font-family: var(--label); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 22px 0 12px; }
.themeGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.themeCard {
  border: 1.5px solid var(--line-2); border-radius: 14px; padding: 12px; cursor: pointer;
  background: var(--surface); transition: border-color .15s ease, transform .1s ease;
}
.themeCard:active { transform: scale(.98); }
.themeCard.on { border-color: var(--magenta); box-shadow: 0 0 0 1px var(--magenta); }
.themeCard .swatches { display: flex; gap: 6px; margin-bottom: 10px; }
.themeCard .sw { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); }
.themeCard .tName { font-family: var(--display); font-size: 16px; color: var(--ink); font-weight: 700; }
.themeCard .tCheck { float: right; color: var(--magenta); font-family: var(--label); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
.sBtn {
  display: block; width: 100%; text-align: left;
  font-family: var(--body); font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 15px 16px; margin-top: 10px; cursor: pointer;
}
.sBtn .sArrow { float: right; color: var(--muted); }
.settings .sAbout { font-family: var(--body); font-size: 12.5px; color: var(--muted); margin-top: 22px; line-height: 1.5; }

/* ---- Tutorial ---- */
.tut { text-align: left; }
.tut .tArt {
  height: 128px; border-radius: 16px; margin: 8px 0 20px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--magenta), var(--magenta-d));
  color: #fff;
}
.tut .tArt svg { width: 58px; height: 58px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.tut .tStep { font-family: var(--label); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.tut .tHead { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--ink); margin: 8px 0 0; line-height: 1.15; }
.tut .tBody { font-family: var(--body); font-size: 15.5px; line-height: 1.6; color: var(--ink-2); margin: 12px 0 0; }
.tut .tNav { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; }
.tut .tDots { display: flex; gap: 7px; }
.tut .tDot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.tut .tDot.on { background: var(--magenta); }
.tut .tSkip { font-family: var(--label); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); background: none; border: none; cursor: pointer; }
.tut .tNext {
  font-family: var(--label); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  color: var(--paper); background: var(--ink); border: none; border-radius: 999px; padding: 12px 24px; cursor: pointer;
}

/* ============================================================================
   LOCATION BAR + PICKER  (Out & About)
   ============================================================================ */
.locBar {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 11px 14px; margin-bottom: 10px; cursor: pointer; color: var(--ink);
  box-shadow: var(--shadow);
}
.locPin { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: var(--magenta); stroke-width: 1.8; stroke-linejoin: round; }
.locName { font-family: var(--display); font-size: 17px; font-weight: 700; flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.locRadius { font-family: var(--label); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); background: var(--paper); padding: 4px 8px; border-radius: 999px; flex: 0 0 auto; }
.locChevron { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }

.locSearch {
  width: 100%; font-family: var(--body); font-size: 16px; color: var(--ink);
  padding: 12px 14px; margin: 10px 0 4px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); outline: none;
}
.locSearch:focus { border-color: var(--magenta); }
.locResults { display: flex; flex-direction: column; }
.locResult {
  text-align: left; font-family: var(--body); font-size: 16px; color: var(--ink);
  background: none; border: none; border-bottom: 1px solid var(--line); padding: 14px 4px; cursor: pointer;
}
.locResult:active { background: var(--paper); }
.locHint { font-family: var(--body); font-size: 14px; color: var(--muted); padding: 12px 4px; }

.badge.dist { color: var(--ink-2); }
.note { font-family: var(--body); font-size: 12.5px; line-height: 1.5; color: var(--muted); padding: 0 2px 8px; }
.bigBtn {
  font-family: var(--label); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700;
  color: var(--paper); background: var(--ink); border: none; border-radius: 999px; padding: 14px 28px; cursor: pointer;
}
