:root {
  --bg: #F2ECE3; --card: #FBF8F3; --ink: #141113; --muted: #7A7068;
  --gold: #A9844E; --line: #DDD3C6; --soft: #EFE7DC;
  --serif: 'Bodoni Moda', 'Didot', Georgia, serif;
  --sans: Jost, 'Futura', system-ui, sans-serif;
  --top: env(safe-area-inset-top, 0px); --bot: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
/* light is the default; dark is picked under your name */
:root[data-theme="dark"] {
  --bg: #0B0B0A; --card: #161514; --ink: #F3EEE6; --muted: #9A948B;
  --gold: #C9A46A; --line: #2A2826; --soft: #1F1E1C;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 300 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button, a, label { touch-action: manipulation; }
/* no text selection or callouts on long-press, except where you type */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
[hidden] { display: none !important; }

#map { position: fixed; inset: 0; background: var(--bg); }
.maplibregl-ctrl-attrib { font: 300 10px var(--sans); }
.maplibregl-ctrl-bottom-left { bottom: var(--bot); }
/* backup map (no WebGL): image tiles greyed into cream / black, markers centred on their point */
#map[data-raster] { background: var(--bg); }
#map[data-raster="light"] .leaflet-tile-pane { filter: grayscale(.8) sepia(.15) brightness(1.04) contrast(.88); }
#map[data-raster="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) grayscale(.8) brightness(.72) contrast(1.15); }
.leaflet-container { font: 300 10px var(--sans); }
.leaflet-bottom { bottom: var(--bot); }
.rmark { position: absolute; transform: translate(-50%, -50%); }

/* header */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--top) + 12px) 20px 22px;
  background: linear-gradient(var(--bg) 55%, transparent);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.logo { margin: 0; font: 400 32px/1 var(--serif); letter-spacing: .005em; white-space: nowrap; }
.logo em { font-style: italic; color: var(--gold); }
.logo.small { font-size: 30px; margin-bottom: 18px; }
.me { font: 400 11px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; background: var(--card); border: 1px solid var(--line); padding: 9px 14px; border-radius: 999px; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* map pins */
.pin { width: 34px; height: 34px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--gold); display: grid; place-items: center; font-size: 17px; line-height: 1; box-shadow: 0 3px 8px rgba(0,0,0,.22); cursor: pointer; }
.pin.sel { width: 44px; height: 44px; font-size: 22px; background: var(--ink); border-width: 2px; }
.pin img { width: 26px; height: 26px; display: block; pointer-events: none; }
.pin.sel img { width: 34px; height: 34px; }
/* Heavenly: a gold glow */
.pin.h5 { box-shadow: 0 0 0 2px var(--gold), 0 0 14px 4px rgba(201, 164, 106, .65); }
.goal img { width: 34px; height: 34px; display: block; }
.noimg img { width: 64%; height: auto; }
.you { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 3px solid var(--gold); box-shadow: 0 0 0 7px rgba(169,132,78,.28); box-shadow: 0 0 0 7px color-mix(in srgb, var(--gold) 28%, transparent); }
.goal { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); border: 2px solid var(--gold); display: grid; place-items: center; font-size: 22px; }

/* round buttons */
.round { position: fixed; right: 20px; z-index: 5; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.fab { bottom: calc(var(--bot) + 30px); width: 60px; height: 60px; background: var(--ink); color: var(--bg); font: 200 34px/1 var(--sans); }
.locate { bottom: calc(var(--bot) + 104px); width: 46px; height: 46px; background: var(--card); color: var(--ink); font-size: 18px; border: 1px solid var(--line); }
.locate span { display: block; transform: rotate(-45deg) translate(1px, 1px); }
.northbtn { bottom: calc(var(--bot) + 162px); width: 46px; height: 46px; background: var(--card); color: var(--gold); font: 300 22px/1 var(--sans); border: 1px solid var(--line); }
.northbtn span { display: block; }
body.busy .round { display: none; }

/* placing a pin */
.crosshair { position: fixed; left: 50%; top: 50%; z-index: 6; transform: translate(-50%, -50%); pointer-events: none; }
.crosshair span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--ink); border: 2px solid var(--gold); font-size: 26px; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.placebar { position: fixed; left: 20px; right: 20px; bottom: calc(var(--bot) + 26px); z-index: 7; display: flex; gap: 10px; }

/* buttons */
.btn { flex: 1; display: block; text-align: center; text-decoration: none; padding: 17px 10px; border-radius: 999px; font: 500 11px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; }
.btn.small { flex: 0 0 auto; padding: 13px 18px; }
.solid { background: var(--ink); color: var(--bg); }
.line { border: 1px solid var(--ink); color: var(--ink); background: var(--card); }
.btn:disabled { opacity: .45; }

/* bottom sheet */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
  max-height: 78vh; max-height: 78dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 26px 26px 0 0;
  padding: 12px 22px calc(var(--bot) + 24px);
  box-shadow: 0 -10px 30px rgba(0,0,0,.18);
}
@media (min-width: 640px) { .sheet { left: 50%; width: 440px; margin-left: -220px; } }
.grab { width: 36px; height: 3px; border-radius: 2px; background: var(--line); margin: 0 auto 16px; }
.close { position: absolute; right: 14px; top: 10px; width: 40px; height: 40px; font: 200 26px/1 var(--sans); color: var(--muted); }
.row { display: flex; gap: 16px; align-items: flex-start; }
.photo { width: 92px; height: 112px; flex: none; border-radius: 4px; object-fit: cover; background: var(--soft); }
.noimg { display: grid; place-items: center; font-size: 40px; }
.kicker { font: 400 10px/1.3 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--gold); min-height: 13px; }
h2 { font: 400 30px/1.05 var(--serif); margin: 8px 0 6px; overflow-wrap: anywhere; }
.sub { font: 300 13px/1.4 var(--sans); color: var(--muted); }
.score { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.dots { display: flex; gap: 5px; align-items: center; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.dots i.off { background: none; box-shadow: inset 0 0 0 1px var(--gold); }
.score b { font: italic 400 17px var(--serif); }
.score span { font: 300 12px var(--sans); color: var(--muted); letter-spacing: .06em; }
.note { border-top: 1px solid var(--line); padding: 14px 0 0; margin-top: 16px; }
.who { font: 400 10px/1.4 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.who b { color: var(--ink); font-weight: 500; }
.note p { font: italic 400 17px/1.35 var(--serif); margin: 8px 0 0; overflow-wrap: anywhere; }
.btns { display: flex; gap: 10px; margin-top: 22px; }
.del { display: block; margin: 18px auto 0; padding: 10px 14px; font: 500 10px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }

/* forms */
form label { display: block; font: 400 10px/1 var(--sans); letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin: 20px 0 10px; }
input, textarea { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; border-radius: 0; padding: 8px 0 10px; font: 400 20px/1.3 var(--serif); }
textarea { min-height: 70px; resize: vertical; font-style: italic; }
input:focus, textarea:focus { outline: none; border-bottom-color: var(--gold); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale button { border: 1px solid var(--line); border-radius: 12px; padding: 10px 2px 9px; font: italic 400 13px/1 var(--serif); color: var(--ink); background: var(--card); }
.scale button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.scale .dots { justify-content: center; margin-bottom: 8px; gap: 2px; }
.scale .dots i { width: 5px; height: 5px; }
.roses { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.roses button { border: 1px solid var(--line); border-radius: 12px; padding: 6px 2px 8px; font: italic 400 12px/1 var(--serif); color: var(--ink); background: var(--card); }
.roses button img { display: block; width: 34px; height: 34px; margin: 0 auto 4px; }
.roses button[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: var(--soft); }
.pick { display: flex; align-items: center; gap: 14px; }
.pick .photo { width: 72px; height: 88px; }
.pick input { display: none; }
form .pick label.btn { flex: 0 1 auto; margin: 0; padding: 13px 18px; color: var(--ink); letter-spacing: .24em; cursor: pointer; }

/* name modal */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.4); display: grid; place-items: center; padding: 20px; }
.card { width: 100%; max-width: 360px; background: var(--card); border-radius: 26px; padding: 30px 24px 22px; text-align: center; }
.card label { text-align: left; }
.card .btn { width: 100%; margin-top: 24px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg button { border: 1px solid var(--line); border-radius: 999px; padding: 13px 8px; font: 500 11px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--ink); background: var(--card); }
.seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* walking directions */
.navtop { position: fixed; left: 14px; right: 14px; top: calc(var(--top) + 12px); z-index: 9; background: var(--ink); color: var(--bg); border-radius: 22px; padding: 16px 18px; display: flex; gap: 16px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.turn { font: 300 34px/1 var(--sans); width: 40px; text-align: center; color: var(--gold); flex: none; }
.navd { font: 400 11px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; opacity: .7; }
.navt { font: 400 21px/1.15 var(--serif); margin-top: 6px; }
.navbot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--card); border-radius: 26px 26px 0 0; padding: 18px 22px calc(var(--bot) + 22px); display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 -10px 30px rgba(0,0,0,.18); }
.big { font: 400 30px/1 var(--serif); }
.sm { font: 300 12px/1.3 var(--sans); color: var(--muted); margin-top: 6px; letter-spacing: .06em; }
.navbtns { display: flex; gap: 8px; }
.arrowscr { position: fixed; inset: 0; z-index: 10; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding: calc(var(--top) + 20px) 20px calc(var(--bot) + 20px); }
.arrowscr .kicker { font-size: 11px; }
.ring { width: min(72vw, 280px); aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; position: relative; }
.ring::after { content: ''; position: absolute; inset: 18px; border-radius: 50%; border: 1px solid var(--line); }
.arr { font: 300 130px/1 var(--sans); color: var(--gold); transition: transform .25s linear; }
.north { position: absolute; inset: 0; font: 500 11px/1 var(--sans); letter-spacing: .2em; color: var(--muted); padding-top: 4px; transition: transform .25s linear; }
.dist { font: 400 68px/1 var(--serif); }
.dist small { font: 300 18px var(--sans); letter-spacing: .2em; margin-left: 6px; }

.toast { position: fixed; left: 50%; top: calc(var(--top) + 80px); transform: translateX(-50%); z-index: 30; background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font: 400 12px/1.2 var(--sans); letter-spacing: .08em; max-width: calc(100vw - 40px); text-align: center; }

/* feed */
.chips { display: flex; gap: 8px; align-items: center; min-width: 0; }
#feedBtn { flex: none; }
.chips #me { flex: 0 1 auto; min-width: 0; max-width: 34vw; }
.feed { position: fixed; inset: 0; z-index: 12; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; padding: calc(var(--top) + 14px) 20px calc(var(--bot) + 30px); }
.feedhead { display: flex; align-items: center; justify-content: space-between; max-width: 560px; margin: 0 auto 6px; position: sticky; top: calc(-1 * var(--top) - 14px); padding-top: 4px; background: var(--bg); z-index: 1; }
.feedhead .logo.small { margin: 0; font-style: italic; color: var(--gold); }
.feedhead .close { position: static; }
#feedList { max-width: 560px; margin: 0 auto; }
.post { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.post.new { animation: slidein .5s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.post .rose { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--gold); display: grid; place-items: center; }
.post .rose img { width: 32px; height: 32px; }
.post .rose.h5 { box-shadow: 0 0 0 2px var(--gold), 0 0 12px 3px rgba(201, 164, 106, .55); }
.post .body { min-width: 0; flex: 1; }
.post .what { font: 300 15px/1.35 var(--sans); }
.post .what b { font-weight: 500; }
.post .what em { font: italic 400 18px var(--serif); }
.post .when { font: 400 10px/1.4 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.post .when span { color: var(--gold); }
.post p { font: italic 400 17px/1.35 var(--serif); margin: 8px 0 0; overflow-wrap: anywhere; }
.post .pic { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 6px; margin-top: 10px; background: var(--soft); }
.more { display: block; margin: 20px auto 0; }
.post .show { margin-top: 12px; }

/* bouquet: several roses close together */
.pin.bouquet { width: 44px; height: 44px; position: relative; }
.pin.bouquet .flowers { font-size: 24px; line-height: 1; }
.pin.bouquet .count { position: absolute; right: -6px; top: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--ink); color: var(--bg); font: 500 11px/20px var(--sans); text-align: center; }
.bq { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 12px 0; border-top: 1px solid var(--line); }
.bq:first-of-type { margin-top: 12px; }
.bq .rose { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--gold); display: grid; place-items: center; }
.bq .rose img { width: 32px; height: 32px; }
.bq .rose.h5 { box-shadow: 0 0 0 2px var(--gold), 0 0 12px 3px rgba(201, 164, 106, .55); }
.bq em { font: italic 400 19px var(--serif); }
.bq small { font: 300 12px var(--sans); color: var(--muted); letter-spacing: .06em; }
