:root {
  /* Neutral canvas; the brand pink-to-purple is the accent, not the base. */
  --bg: #F7F6F4;
  --card: #ffffff;
  --ink: #2B1840;
  --muted: #6F6A75;
  --line: #E9E6EA;
  --soft: #F1EFF2;
  --brand: #E04A78;
  --brand-pressed: #C2407A;
  --brand-ink: #ffffff;
  --brand-soft: #FDEEF2;
  --brand-gradient: linear-gradient(45deg, #FFB86B 0%, #F2557A 50%, #9B3FC4 100%);
  --accent: #9B3FC4;
  --selected: #2B1840;
  --selected-ink: #ffffff;
  --tip: #FFF5E6;
  --kept: #2e7d5b;
  --warn: #b5541c;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(20 10 30 / 5%), 0 6px 18px rgb(20 10 30 / 6%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  /* "Warm dusk": soft plum-charcoal with lifted cards and a faint sunset glow. */
  :root {
    --bg: #1F1B24; --card: #2B2631; --ink: #F6F2F7; --muted: #B4ADBB; --line: #3A3441; --soft: #352F3C;
    --brand: #FF6F98; --brand-pressed: #E04A78; --brand-ink: #ffffff; --brand-soft: #3A1E29; --accent: #c98be8;
    --selected: #F6F2F7; --selected-ink: #1F1B24; --tip: #3A3024;
    --kept: #6fc29b; --warn: #f0a070;
    --shadow: 0 8px 24px -12px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
  body { background: radial-gradient(120% 50% at 100% 0%, rgb(155 63 196 / 26%), transparent 60%), radial-gradient(100% 40% at 0% 0%, rgb(255 184 107 / 16%), transparent 60%), var(--bg); background-attachment: fixed; }
}
* { box-sizing: border-box; }
.social-help { border: 1.5px solid var(--brand); border-radius: var(--radius); padding: 14px; background: var(--card); display: grid; gap: 6px; transition: box-shadow .3s; }
.social-help.done { border-color: var(--kept); }
.social-help.nudge-pulse { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 30%, transparent); }
.social-help p { margin: 0; }
.social-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0; }
.social-actions .btn { justify-content: center; }
.social-actions [data-paste] { grid-column: 1 / -1; }
.file-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.picked { flex-wrap: wrap; overflow: visible; padding: 0; margin: 0; }
.picked .chip button { border: 0; background: none; color: inherit; margin-left: 4px; cursor: pointer; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
  min-height: 100dvh;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; font-weight: 800; }
h2 { font-size: 1.35rem; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--ink);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand-gradient); opacity: .9; }
.topbar h1 { flex: 1; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: 0; color: inherit; font-size: 1.5rem; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; }
.icon-btn:active { background: var(--bg); }
#account { color: var(--muted); }
.screen { max-width: 720px; margin: 0 auto; padding: 16px; }
.center { text-align: center; padding-top: 48px; }
.hero-icon { width: 72px; height: 72px; }
.stack { display: grid; gap: 14px; text-align: left; margin-top: 16px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
input, textarea, select {
  font: inherit; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); width: 100%;
}
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn[disabled] { opacity: .5; }
.trip-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.trip-list a {
  display: block; padding: 14px 16px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
}
.tabs { position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  max-width: 520px; margin: 0 auto; padding: 6px; border-radius: 24px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 96%, transparent); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 10px 30px -8px rgb(30 10 20 / 28%), 0 2px 6px rgb(30 10 20 / 8%); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; border-radius: 18px; text-decoration: none; color: color-mix(in srgb, var(--ink) 72%, transparent); font-weight: 700; font-size: .74rem; letter-spacing: .01em; -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s; }
.tabs a svg { width: 25px; height: 25px; }
.tabs a:active { background: var(--brand-soft); }
.tabs a[aria-selected="true"] { color: #fff; background: linear-gradient(135deg, #FF9F6B 0%, #F2557A 100%); box-shadow: 0 6px 14px -6px color-mix(in srgb, #F2557A 70%, transparent); }
.tabs a[aria-selected="true"] svg { filter: none; }
body.has-tabbar #view { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.has-tabbar #toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
.cards { display: grid; gap: 12px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-columns: 96px 1fr; }
.card .photo { width: 96px; height: 100%; min-height: 110px; object-fit: cover; background: var(--line); }
.card .body { padding: 10px 12px; display: grid; gap: 4px; }
.card .name { font-weight: 700; }
.card .meta { font-size: .85rem; color: var(--muted); }
.card .note { font-size: .9rem; }
.card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.attrib { font-size: .7rem; color: var(--muted); }
.toggle { border-radius: 999px; padding: 6px 12px; font-weight: 700; border: 1px solid var(--kept); background: var(--kept); color: #fff; }
.card.dropped .toggle { background: none; color: var(--muted); border-color: var(--line); }
#map { width: 100%; height: calc(100dvh - 330px); min-height: 360px; border-radius: var(--radius); box-shadow: var(--shadow); }
.day { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 12px; }
.day h3 { font-size: 1.05rem; }
.day ol { padding-left: 22px; margin: 8px 0; }
.day li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.day li:last-child { border-bottom: 0; }
.day li .row { justify-content: space-between; }
.day ol { padding-left: 20px; }
.day select { width: auto; padding: 4px 8px; font-size: .85rem; }
.warn { color: var(--warn); font-size: .85rem; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--bg); font-size: .8rem; color: var(--muted); }
#toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; padding: 12px 16px; border-radius: 12px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow); z-index: 10;
}
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 24px 0; }

.btn.primary:active { background: var(--brand-pressed); border-color: var(--brand-pressed); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font: inherit; font-size: .88rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.chip span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip[aria-pressed="true"] span { color: inherit; opacity: .85; }

/* Place detail sheet */
.card { cursor: pointer; }
body.sheet-open { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgb(20 10 30 / 45%); display: flex; align-items: flex-end; justify-content: center; }
.sheet { position: relative; width: 100%; max-width: 640px; max-height: 92dvh; overflow-y: auto; background: var(--bg); color: var(--ink);
  border-radius: 22px 22px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgb(0 0 0 / 20%); }
.sheet-close { position: sticky; top: 0; float: right; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--card); color: var(--ink); font-size: 1rem; box-shadow: var(--shadow); }
.sheet h2 { margin: 6px 0 4px; font-size: 1.4rem; }
.sheet h3 { margin: 18px 0 6px; font-size: 1rem; }
.sheet p { margin: 6px 0; }
.sheet-photos { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px 8px; padding: 0 16px; scrollbar-width: none; }
.sheet-photos::-webkit-scrollbar { display: none; }
.sheet-photos figure { margin: 0; flex: none; width: 78%; scroll-snap-align: start; }
.sheet-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: var(--line); display: block; }
.sheet-photos figcaption { font-size: .72rem; color: var(--muted); margin-top: 3px; }
.sheet-photos figcaption a { color: inherit; }
.stars { color: #F2A33A; letter-spacing: 1px; }
.open { color: var(--kept); font-weight: 600; }
.closed { color: var(--warn); font-weight: 600; }
.saved-note { background: var(--card); border-left: 4px solid var(--brand); border-radius: 12px; padding: 10px 12px; margin: 12px 0; box-shadow: var(--shadow); }
.saved-note .label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }
.sheet-actions { gap: 8px; margin: 12px 0; }
.hours { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.hours li { padding: 3px 0; }
.hours li.today { font-weight: 700; }
.review { border-top: 1px solid var(--line); padding: 10px 0; }
.review .row { gap: 10px; align-items: center; }
.review .avatar { width: 32px; height: 32px; border-radius: 50%; }
.review a { color: var(--ink); text-decoration: none; }
.review p { font-size: .93rem; }

/* Meal and drink slots */
.slot-pick { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; margin-top: 6px; }
.slot-pick select { padding: 5px 8px; font-size: .88rem; border-radius: 999px; width: auto; }
.slot-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }
.day li.slot a { color: var(--ink); text-decoration: none; }
.day li a[data-open] { color: var(--ink); text-decoration: none; }
.day li .muted a { color: var(--brand); }

/* Sharing */
.share-url { width: 100%; font: inherit; font-size: .9rem; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); margin: 8px 0; }
.shared-head { margin-bottom: 12px; }
.shared-head h2 { margin: 2px 0 4px; }
#map.shared-map { height: 280px; min-height: 0; border-radius: 14px; overflow: hidden; margin-bottom: 12px; }

/* Trip summary above the tabs */
.trip-summary { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 12px 14px; margin-bottom: 12px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; border-left: 4px solid var(--brand); }
.trip-summary .ts-city { grid-column: 1 / -1; font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; font-weight: 800; font-size: 1.15rem; }
.trip-summary .ts-line { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-summary .ts-missing { color: var(--brand); font-weight: 600; }

/* Editing days */
.stop { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.stop-main { flex: 1; min-width: 0; cursor: pointer; }
.stop-name { font-weight: 700; line-height: 1.25; }
.stop-meta { font-size: .82rem; color: var(--muted); margin-top: 1px; }
.stop-meta a { color: var(--brand); text-decoration: none; }
.icon-sm.more { font-size: 1.2rem; line-height: 1; letter-spacing: 1px; background: transparent; border-color: transparent; color: var(--muted); }
.action-sheet h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.action-sheet .chips { flex-wrap: wrap; overflow: visible; }
.menu-list { display: grid; margin-top: 14px; border-radius: 14px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.menu-list button { text-align: left; font: inherit; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); }
.menu-list button:last-child { border-bottom: 0; }
.menu-list button.danger { color: var(--warn); }
.icon-sm { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: .9rem; padding: 0; }
.icon-sm:disabled { opacity: .3; }
.day select.add-stop { width: 100%; margin-top: 4px; padding: 8px 10px; border-radius: 999px; border: 1px dashed var(--brand); background: transparent; color: var(--brand); font: inherit; font-weight: 600; font-size: .9rem; }
.tips { display: grid; gap: 6px; margin: 8px 0; }
.tip { background: color-mix(in srgb, var(--brand) 9%, var(--card)); border-radius: 12px; padding: 8px 10px; font-size: .88rem; }
.tip .btn { margin-left: 4px; padding: 3px 10px; font-size: .82rem; }

/* Brand in the top bar */
.topbar .brand { flex: 1; display: flex; align-items: center; }
.topbar .brand a { display: inline-flex; }
.topbar .brand img { height: 30px; width: auto; display: block; }

/* Getting around: numbered stops with travel legs between them */
h3.sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.muted.small, .small.muted { font-size: .82rem; }
.day ol { list-style: none; counter-reset: stop; padding-left: 0; }
.day ol .stop::before { counter-increment: stop; content: counter(stop); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: .78rem; font-weight: 700; display: grid; place-items: center; }
.leg { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -2px 0 6px 11px; padding: 2px 0 2px 18px; border-left: 2px dotted var(--line); }
.day > .leg { margin-top: 2px; }
.leg-mode { font: inherit; font-size: .84rem; font-weight: 600; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--ink); cursor: pointer; }
.leg-mode:disabled { cursor: default; border-color: transparent; padding-left: 0; }
.leg-set .leg-mode { border-color: var(--brand); }
.leg-go { font-size: .82rem; font-weight: 600; color: var(--brand); text-decoration: none; white-space: nowrap; }
#travel-mode { flex-wrap: wrap; overflow: visible; }
.day-totals { margin-top: 2px; }
.day li a.leg-go, .leg-go { color: var(--brand); }

/* Places: heart to keep, compact "Plan for" */
.ink { color: var(--ink); }
.photo-wrap { position: relative; }
.card .photo-wrap .photo { height: 100%; }
.heart { position: absolute; top: 6px; left: 6px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--brand); font-size: 1.35rem; line-height: 1; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: pointer; }
.heart[aria-pressed="false"] { color: #8a8394; }
.heart.pop { animation: pop .25s ease-out; }
@keyframes pop { 50% { transform: scale(1.25); } }
.card.dropped .photo { filter: grayscale(1); opacity: .55; }
.card.dropped .body > :not(.actions) { opacity: .55; }
.slot-chip { width: auto; font: inherit; font-size: .84rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px dashed var(--line); background: var(--card); color: var(--muted); }
.slot-chip.set { border: 1px solid var(--brand); color: var(--brand); }
.keep-btn[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); }
.btn { white-space: nowrap; }

/* Trip tab: optional travel times */
details.optional { background: var(--card); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow); }
details.optional summary { font-weight: 700; cursor: pointer; }
details.optional[open] summary { margin-bottom: 6px; }
details.optional > * + * { margin-top: 10px; }
.travel-leg { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 12px; margin: 10px 0 0; display: grid; gap: 8px; }
.travel-leg legend { font-weight: 700; font-size: .9rem; padding: 0 4px; }
.day-time { font-size: .86rem; margin-top: 4px; padding: 6px 10px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 8%, transparent); }

/* iOS Safari gives date/time inputs a fixed native width that ignores the layout: let them shrink. */
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; width: 100%; min-height: 48px; text-align: left; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; }
.row > *, .row > label { min-width: 0; }
.field-hint { font-weight: 500; font-size: .78rem; color: var(--muted); }
html, body { overflow-x: clip; }
.stack .row { align-items: end; }

/* ---------------------------------------------------------------- visual refresh */
.topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 0; }
.topbar::after { height: 2px; opacity: .55; }
.screen { padding: 20px 16px 24px; }
h3.sub { margin-top: 4px; }

/* Chips: selected is solid ink, not pink */
.chip { border-color: var(--line); background: var(--card); }
.chip[aria-pressed="true"] { background: var(--selected); border-color: var(--selected); color: var(--selected-ink); }

/* Trip summary: clean card with a thin gradient edge */
.trip-summary { border-left: 0; position: relative; overflow: hidden; padding: 14px 16px 14px 20px; }
.trip-summary::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--brand-gradient); }
.trip-summary .ts-line { color: var(--muted); font-size: .92rem; }

/* Place cards: photo first, large */
.cards { gap: 16px; }
.card { grid-template-columns: 1fr; border: 1px solid var(--line); box-shadow: none; }
.card .photo-wrap { aspect-ratio: 16 / 9; background: var(--soft); overflow: hidden; }
.card .photo-wrap .photo, .card .photo { width: 100%; height: 100%; min-height: 0; display: block; }
.card .photo:not([src]), .card .photo[src=""] { visibility: hidden; }
.card .photo-wrap.no-photo { aspect-ratio: auto; height: 60px; background: var(--soft); }

.card .body { padding: 12px 14px 12px; gap: 3px; }
.card .name { font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; font-weight: 800; font-size: 1.08rem; }
.heart { left: auto; right: 10px; top: 10px; width: 40px; height: 40px; z-index: 1; background: rgb(255 255 255 / 94%); }
.card.dropped .photo { filter: grayscale(1); opacity: .5; }

/* Days */
.day { border: 1px solid var(--line); box-shadow: none; padding: 14px 16px; }
.day ol .stop::before { background: var(--selected); color: var(--selected-ink); }
.day li.slot .stop::before { background: var(--brand-gradient); color: #fff; }
.tip { background: var(--tip); }
.day-time { background: var(--soft); }
.leg { border-left-color: var(--line); }
.slot-label { color: var(--brand); }
details.optional { border: 1px solid var(--line); box-shadow: none; }
.btn:not(.primary) { background: var(--card); border-color: var(--line); }

/* Profiles */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; }
.avatar-initials { background: var(--brand-gradient); color: #fff; font-weight: 800; letter-spacing: .02em; }
#account .avatar { box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--brand); }
.profile-head { display: grid; place-items: center; margin: 8px 0 4px; }
.profile-pic { display: grid; justify-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.pic-edit { font-size: .85rem; color: var(--brand); }
.handle-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding-left: 12px; }
.handle-input > span { color: var(--muted); font-weight: 700; }
.handle-input input { border: 0; padding-left: 4px; background: transparent; }
.field-hint.ok { color: var(--kept); }
.field-hint.bad { color: var(--warn); }
.nudge { display: grid; gap: 2px; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px dashed var(--brand); color: var(--ink); text-decoration: none; }
.shared-row { display: flex !important; gap: 12px; align-items: center; }
.person-card { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.person-name { font-weight: 800; font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; }
.people-list { display: grid; gap: 8px; margin: 10px 0 4px; }
.person-row { display: flex; gap: 10px; align-items: center; }
.person-row > span:not(.avatar) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[hidden] { display: none !important; }

/* Sunset trip card and colour-coded category chips (both themes) */
.trip-summary { background: var(--brand-gradient); color: #fff; box-shadow: 0 10px 30px -10px rgb(224 74 120 / 55%); padding: 18px 18px 16px; }
.trip-summary::before { display: none; }
.trip-summary .ts-city { font-size: 1.4rem; color: #fff; }
.trip-summary .ts-line, .trip-summary .ts-missing { color: rgb(255 255 255 / 92%); }
.chip[data-filter="food"]:not([aria-pressed="true"]) { border-color: #F6B26B; }
.chip[data-filter="drinks"]:not([aria-pressed="true"]) { border-color: #C98BE8; }
.chip[data-filter="shops"]:not([aria-pressed="true"]) { border-color: #6FC2B0; }
.chip[data-filter="sights"]:not([aria-pressed="true"]) { border-color: #7FB0E8; }
.chip[data-filter="activities"]:not([aria-pressed="true"]) { border-color: #F2557A; }
@media (prefers-color-scheme: dark) {
  .topbar { background: rgb(31 27 36 / 70%); }
  .card, .day, details.optional, .trip-list a { box-shadow: var(--shadow); border-color: transparent; }
}

/* Trips list */
.trip-row { display: flex !important; gap: 12px; align-items: center; }
.trip-dot { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 800; font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; background: var(--soft); color: var(--muted); }
.trip-dot.soon { background: var(--brand-gradient); color: #fff; }
.empty-trip { text-align: center; padding: 28px 12px; display: grid; gap: 10px; justify-items: center; }
.danger-link { color: var(--warn); }

/* Friends and companions */
.avatar-stack { display: inline-flex; margin-left: auto; padding-left: 8px; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--card); }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar-more { background: var(--soft); color: var(--muted); font-size: .7rem; font-weight: 700; }
.ts-people { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 600; font-size: .9rem; }
.ts-people .avatar-stack { margin-left: 0; padding-left: 0; }
.ts-people .avatar-stack .avatar { box-shadow: 0 0 0 2px rgb(255 255 255 / 85%); }
.invite-card { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; padding: 14px; margin-top: 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--brand); }
.invite-card > .row { grid-column: 1 / -1; justify-content: flex-end; }
.friends-link { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; }
.person-row .btn + .btn { margin-left: 4px; }
.avatar { flex: none !important; }

/* Travel map, ranks, been and reviews */
.travel { display: grid; gap: 12px; margin-top: 12px; }
.rank-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius); background: var(--brand-gradient); color: #fff; box-shadow: 0 10px 30px -12px rgb(224 74 120 / 55%); }
.rank-card .slot-label { color: rgb(255 255 255 / 85%); }
.rank-card .muted { color: rgb(255 255 255 / 90%); }
.rank-badge { width: 58px; height: 58px; border-radius: 50%; background: rgb(255 255 255 / 22%); display: grid; place-items: center; font-size: 1.9rem; flex: none; }
.rank-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.rank-name { font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; font-weight: 800; font-size: 1.35rem; }
.rank-bar { height: 8px; border-radius: 99px; background: rgb(255 255 255 / 30%); overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: #fff; border-radius: inherit; }
.travel-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.travel-stats div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 2px; display: grid; }
.travel-stats strong { font-size: 1.2rem; font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; }
.travel-stats span { font-size: .68rem; color: var(--muted); }
.world-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.world { width: 100%; height: auto; display: block; }
.world path { fill: var(--soft); stroke: var(--line); stroke-width: .25; }
.world path.v { fill: url(#wg); stroke: #fff; }
.world path.p { fill: color-mix(in srgb, var(--accent) 18%, var(--soft)); stroke: var(--accent); stroke-dasharray: 1 1; }
.world circle { fill: #fff; stroke: var(--ink); stroke-width: .5; }
.map-key { margin: -4px 0 0; display: flex; gap: 6px; align-items: center; }
.key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.key.v { background: var(--brand-gradient); }
.key.p { border: 1px dashed var(--accent); }
.visit-chips { flex-wrap: wrap; overflow: visible; margin-top: 10px; }
.how-points summary { cursor: pointer; }
.been-btn[aria-pressed="true"] { background: var(--kept); border-color: var(--kept); color: #fff; }
.pin-reviews { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--soft); }
.pin-reviews h3 { margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.my-review { display: grid; gap: 8px; margin-bottom: 10px; }
.star-input button { font-size: 1.6rem; line-height: 1; background: none; border: 0; padding: 0 2px; color: color-mix(in srgb, var(--muted) 45%, transparent); cursor: pointer; }
.star-input button[aria-pressed="true"] { color: #F2A33A; }
.pin-review.friend { border-left: 3px solid var(--brand); padding-left: 10px; }
.friend-tag { font-size: .7rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 99px; padding: 1px 7px; }
.review-photos { display: flex; gap: 6px; overflow-x: auto; margin: 6px 0; scrollbar-width: none; }
.review-photos .rp { position: relative; flex: none; }
.review-photos img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; display: block; }
.rp-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgb(0 0 0 / 60%); color: #fff; font-size: .75rem; cursor: pointer; }
.add-photo { justify-self: start; cursor: pointer; }

/* City photos on trip tiles and the trip header */
.trip-dot { width: 52px; height: 52px; border-radius: 14px; overflow: hidden; }
.trip-dot.has-photo { background: var(--soft); }
.trip-dot img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fade-in .35s ease; }
.city-credits { font-size: .72rem; margin: 6px 4px 0; opacity: .75; }
.trip-summary.has-photo { background: linear-gradient(180deg, rgb(20 12 28 / 25%) 0%, rgb(20 12 28 / 78%) 100%), var(--city-photo) center / cover no-repeat, var(--brand-gradient); min-height: 150px; align-content: end; }
.trip-summary.has-photo .ts-city { font-size: 1.6rem; text-shadow: 0 2px 10px rgb(0 0 0 / 40%); }
.trip-summary.has-photo .ts-line { text-shadow: 0 1px 6px rgb(0 0 0 / 45%); }
.ts-credit { font-size: .66rem; color: rgb(255 255 255 / 75%); margin-top: 6px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
/* Send reels by DM (profile) */
.ig-dm { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); display: grid; gap: 8px; }
.ig-dm p, .ig-dm ol { margin: 0; }
.ig-dm ol { padding-left: 20px; display: grid; gap: 6px; }
.ig-dm-head { display: flex; justify-content: space-between; align-items: center; }
.ig-dm-state { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); }
.ig-dm-state.ok { background: color-mix(in srgb, var(--kept) 15%, transparent); color: var(--kept); }
.ig-dm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ig-dm-code { border-top: 1px solid var(--line); padding-top: 8px; }
.code-chip { font: 700 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; padding: 6px 10px; border-radius: 8px; border: 1.5px dashed var(--brand); background: transparent; color: var(--ink); cursor: pointer; }

/* Keep / Leave out switch on place cards */
.keep-switch { position: absolute; top: 10px; right: 10px; z-index: 1; display: flex; padding: 3px; gap: 2px; border-radius: 99px; background: rgb(255 255 255 / 95%); box-shadow: 0 2px 8px rgb(0 0 0 / 20%); }
.keep-switch button { border: 0; background: transparent; color: #5b5468; font: 700 .82rem/1 Inter, system-ui, sans-serif; padding: 8px 12px; min-height: 34px; border-radius: 99px; cursor: pointer; }
.keep-switch button[data-keepval="1"][aria-pressed="true"] { background: var(--brand-gradient); color: #fff; }
.keep-switch button[data-keepval="0"][aria-pressed="true"] { background: #3b3446; color: #fff; }

/* Privacy and safety */
.legal-note { margin-top: 18px; text-align: center; }
.legal-note a, .legal-links a { color: var(--brand); }
.legal-links { line-height: 2; }
.blocked-box, .delete-box { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.blocked-box summary, .delete-box summary { cursor: pointer; font-weight: 700; }
.delete-box .stack { margin-top: 8px; }
.btn.danger { background: var(--warn); border-color: var(--warn); color: #fff; }
.review-actions { display: flex; gap: 14px; margin-top: 6px; }
.review-actions button { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .8rem; text-decoration: underline; cursor: pointer; }
.report-form { margin-top: 8px; display: grid; gap: 8px; }
/* Date range picker: arrival and leaving day in one calendar */
.range-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.range-summary { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: 600 .95rem Inter, system-ui, sans-serif; text-align: left; cursor: pointer; }
.range-summary.empty { color: var(--muted); }
.range-summary[aria-expanded="true"] { border-color: var(--brand); }
.range-count { flex: none; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }
.cal { margin-top: 8px; padding: 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-head .icon-sm { width: 36px; height: 36px; font-size: 1.2rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; text-align: center; }
.cal-wd span { font-size: .72rem; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.cal-grid button { height: 40px; border: 0; background: transparent; color: var(--ink); font: 600 .92rem Inter, system-ui, sans-serif; cursor: pointer; border-radius: 0; }
.cal-grid button.past { color: var(--muted); opacity: .6; }
.cal-grid button.today { text-decoration: underline; text-underline-offset: 3px; }
.cal-grid button.rin { background: var(--brand-soft); }
.cal-grid button.rs, .cal-grid button.re { background: var(--brand); color: #fff; border-radius: 12px; }
.cal-grid button.rs:has(~ .rin), .cal-grid button.rs:has(~ .re) { border-radius: 12px 0 0 12px; }
.cal-grid button.re { border-radius: 0 12px 12px 0; }
.cal-grid button.rs.re { border-radius: 12px; }
.cal-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; font-size: .85rem; font-weight: 600; flex-wrap: wrap; }

/* Days: timeline */
.days-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 10px; }
.days-title { font: 800 1.3rem "Plus Jakarta Sans", Inter, system-ui, sans-serif; margin: 0; }
.date-strip { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 6px; scrollbar-width: none; }
.date-strip::-webkit-scrollbar { display: none; }
.ds-day { flex: none; width: 62px; padding: 8px 0 7px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-align: center; cursor: pointer; font-family: inherit; display: grid; justify-items: center; gap: 1px; transition: transform .15s; }
.ds-day small { font-size: .66rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ds-day b { font-size: 1.15rem; line-height: 1.2; }
.ds-dots { display: flex; gap: 3px; height: 8px; align-items: center; }
.ds-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.ds-free { font-size: .64rem; font-weight: 600; color: var(--muted); height: 8px; line-height: 8px; }
.ds-day.on { background: var(--selected); color: var(--selected-ink); border-color: transparent; }
.ds-day.on small, .ds-day.on .ds-free { color: color-mix(in srgb, var(--selected-ink) 70%, transparent); }
.ds-day.drop-on { transform: scale(1.08); outline: 2.5px solid var(--brand); }
.ds-un { border-style: dashed; }
.day-map { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 10px; }
#day-map { height: 180px; background: var(--soft); }
.day-map-pills { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.day-map-pills span { background: var(--card); color: var(--ink); border-radius: 99px; padding: 5px 10px; font-size: .76rem; font-weight: 700; box-shadow: 0 1px 4px rgb(0 0 0 / 15%); }
.tip-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.tip-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--tip); border-radius: 14px; padding: 6px 12px; font-size: .8rem; font-weight: 600; }
.tip-chip button { border: 0; background: none; color: var(--brand); font: 700 .8rem Inter, system-ui, sans-serif; padding: 0; cursor: pointer; }
.tl-list { position: relative; padding-top: 4px; }
.tl-list::before { content: ""; position: absolute; left: 56px; top: 10px; bottom: 10px; width: 2px; background: repeating-linear-gradient(var(--line) 0 6px, transparent 6px 10px); }
.tl-row { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; position: relative; }
.tl-time { font-size: .76rem; font-weight: 700; color: var(--muted); text-align: right; }
.tl-home { margin-left: 8px; padding: 10px 12px; border-radius: 14px; background: var(--soft); font-weight: 700; font-size: .88rem; }
.tl-card { position: relative; margin-left: 8px; display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px 8px 8px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); cursor: pointer; touch-action: manipulation; }
.tl-card.editing { grid-template-columns: 22px 50px 1fr auto; }
.tl-n { position: absolute; left: -21px; top: 50%; transform: translate(-50%, -50%); margin-left: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--selected); color: var(--selected-ink); font-size: .7rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg); left: -9px; }
.tl-n.meal { background: var(--brand-gradient); color: #fff; }
.tl-thumb { width: 58px; height: 58px; border-radius: 12px; overflow: hidden; background: var(--soft); display: grid; place-items: center; font-size: 1.4rem; }
.tl-card.editing .tl-thumb { width: 50px; height: 50px; }
.tl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-text { display: grid; gap: 1px; min-width: 0; }
.tl-tag { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); }
.tl-name { font-weight: 700; line-height: 1.25; }
.tl-meta { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tl-text .stop-meta { font-size: .76rem; }
.tl-leg { display: flex; align-items: center; gap: 8px; margin: 6px 0 6px 64px; }
.tl-legchip { border: 0; background: var(--soft); color: var(--ink); border-radius: 99px; padding: 5px 11px; font: 700 .76rem Inter, system-ui, sans-serif; cursor: pointer; }
.tl-legchip:disabled { cursor: default; color: var(--muted); }
.leg-set .tl-legchip { outline: 1.5px solid var(--brand); }
.tl-dir { margin-left: auto; color: var(--brand); font-weight: 700; font-size: .78rem; text-decoration: none; }
.tl-ghost { margin: 6px 0 6px 8px; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 8px; border-radius: 16px; border: 1.5px dashed color-mix(in srgb, var(--brand) 55%, transparent); background: color-mix(in srgb, var(--brand-soft) 70%, transparent); color: var(--brand); text-align: left; font: inherit; cursor: pointer; }
.tl-ghost .tl-thumb { width: 44px; height: 44px; background: var(--card); }
.tl-ghost b { display: block; }
.tl-ghost small { display: block; color: var(--muted); font-weight: 600; font-size: .78rem; }
.tl-plus { margin-left: auto; font-size: 1.2rem; font-weight: 700; }
.tl-list > .tl-row + .tl-row { margin-top: 10px; }
.tl-grip { color: var(--muted); font-size: 1.15rem; font-weight: 800; text-align: center; cursor: grab; touch-action: none; padding: 10px 0; user-select: none; }
.tl-x { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--soft); color: var(--muted); font-weight: 700; cursor: pointer; }
.tl-card.lifted { z-index: 5; box-shadow: 0 18px 30px -12px rgb(40 10 60 / 45%); outline: 2px solid var(--brand); }
.tl-drop { height: 6px; margin: 4px 0 4px 64px; border-radius: 4px; background: var(--brand); opacity: .55; }
.days-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.days-actions .add-stop { flex: 1 1 100%; }

.tl-n { left: 4px; top: 4px; transform: none; width: 20px; height: 20px; font-size: .66rem; box-shadow: 0 0 0 2px var(--card); }
.tl-card.editing .tl-n { left: 30px; }
.tl-row { grid-template-columns: 46px 1fr; }
.tl-list::before { left: 58px; }

/* Links that added places */
.source-list { display: grid; gap: 2px; }
.source-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.source-row:last-child { border-bottom: 0; }
.source-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.source-txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.source-txt strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-row .btn { flex: none; }
.danger-btn { background: #c2413a; border-color: #c2413a; }

/* Home: greeting and city-photo trip cards */
.greet { margin: 0 0 2px; font-weight: 700; color: var(--muted); font-size: .95rem; }
.home-sub { margin: 18px 0 10px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tcard { position: relative; }
.tcard-link { position: relative; display: block; height: 176px; border-radius: 22px; overflow: hidden; color: #fff; text-decoration: none; background: var(--brand-gradient); box-shadow: 0 14px 30px -16px rgb(60 20 80 / 55%); }
.tcard-bg.trip-dot { position: absolute; inset: 0; width: auto; height: auto; border-radius: 0; background: var(--brand-gradient); font-size: 0; }
.tcard-bg img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fade-in .4s ease; }
.tcard-link::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(20 10 30 / 5%) 30%, rgb(20 10 30 / 72%) 100%); }
.tcard-body { position: absolute; left: 16px; right: 90px; bottom: 14px; z-index: 1; display: grid; gap: 2px; }
.tcard-body strong { font: 800 1.45rem/1.15 "Plus Jakarta Sans", Inter, system-ui, sans-serif; text-shadow: 0 2px 10px rgb(0 0 0 / 35%); }
.tcard-body span { font-size: .88rem; font-weight: 600; opacity: .92; }
.tcard-cd { position: absolute; left: 14px; top: 14px; z-index: 1; padding: 6px 11px; border-radius: 99px; background: rgb(20 10 30 / 55%); color: #fff; font-size: .78rem; font-weight: 800; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%); }
.tcard-people { margin-left: auto; }
.tcard .tcard-people { position: absolute; right: 14px; bottom: 14px; z-index: 1; }
.tcard .tcard-people .avatar { box-shadow: 0 0 0 2px rgb(255 255 255 / 90%); }
.tcard-more { position: absolute; right: 10px; top: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgb(20 10 30 / 38%); color: #fff; font-size: 1.15rem; font-weight: 800; cursor: pointer; backdrop-filter: blur(6px); }
.trow { display: flex; align-items: center; gap: 4px; }
.trow .trip-row { flex: 1; min-width: 0; }
.empty-home { text-align: center; padding: 28px 18px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); margin-top: 10px; }
.empty-home h3 { margin: 6px 0; font: 800 1.3rem "Plus Jakarta Sans", Inter, system-ui, sans-serif; }
.empty-art { font-size: 2.6rem; }
.empty-home .row { gap: 8px; flex-wrap: wrap; margin-top: 12px; }

#greet + .row h2 { white-space: nowrap; margin-right: 8px; }
#greet + .row .row .btn { padding: 9px 14px; font-size: .88rem; }
#invites { margin-top: 12px; }

/* Tap a time on the timeline to set it */
.tl-settime { background: none; border: 0; padding: 4px 2px; font: inherit; font-size: .76rem; font-weight: 700; color: var(--muted); text-align: right; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.tl-settime.fixed { color: var(--brand); text-decoration: none; white-space: nowrap; }
.action-sheet input[type=time] { font-size: 1.1rem; }

/* Add a place: search, nearby and your own */
.find-box input { width: 100%; }
.find-results { margin-top: 8px; }
.action-sheet h3 { margin: 18px 0 0; font-size: .9rem; }
.action-sheet .menu-list button strong { font-weight: 700; }
.own-form { display: grid; gap: 12px; }
.own-form .chips { margin: 0; }
.addr-results { margin-top: -4px; }
.tl-addrow { display: block; width: calc(100% - 58px); margin: 10px 0 4px 58px; padding: 13px 14px; border: 1.5px dashed var(--line); border-radius: 14px; background: transparent; color: var(--brand); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }

/* End of the places list */
.places-next { margin: 22px 0 8px; padding: 18px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); text-align: center; }
.places-next p { margin: 0 0 12px; }
.places-next .btn { width: 100%; }

/* Swap a meal */
.tl-card.meal { cursor: pointer; }
.tl-change { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); font-size: .72rem; font-weight: 700; letter-spacing: 0; text-transform: none; }
.swap-now { display: grid; gap: 4px; padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.swap-now .row { gap: 8px; margin-top: 6px; }

/* Sheets: clearly separate from the page behind (tinted surface, warm top edge, dimmed page, slide up) */
:root { --sheet: #FFF4EE; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sheet: #3A2E3A; } }
:root[data-theme="dark"] { --sheet: #3A2E3A; }
.sheet-backdrop { background: rgb(15 8 20 / 58%); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: sheet-fade .18s ease-out; }
.sheet { background: var(--sheet); padding-top: 26px; border-top: 3px solid transparent;
  background-image: linear-gradient(var(--sheet), var(--sheet)), linear-gradient(90deg, #FFB86B, #F2557A);
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: 0 -14px 40px rgb(0 0 0 / 35%); animation: sheet-up .24s cubic-bezier(.2, .9, .3, 1); }
.sheet::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 22%, transparent); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-backdrop { animation: none; } }

/* Call / book / website on a place */
.contact-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.contact-btn { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; background: var(--card); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); min-width: 0; }
.contact-btn .ci { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); font-size: 1.15rem; }
.contact-btn span:last-child { display: grid; min-width: 0; }
.contact-btn b { font-size: .95rem; }
.contact-btn small { color: var(--muted); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-btn.call { background: #1f8a5b; color: #fff; }
.contact-btn.call .ci { background: rgb(255 255 255 / 20%); }
.contact-btn.call small { color: rgb(255 255 255 / 85%); }

/* Days: the day picker and Edit day stay in view while you scroll */
.days-sticky { position: sticky; top: var(--topbar-h, 58px); z-index: 4; margin: 0 -16px 10px; padding: 6px 16px 0; background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.days-sticky.stuck { box-shadow: 0 8px 16px -12px rgb(0 0 0 / 35%); }
.days-sticky .days-head { margin: 0 0 6px; }
.days-sticky .date-strip { margin-bottom: 0; padding-bottom: 8px; }
.tl-calm { color: var(--kept); border-color: color-mix(in srgb, var(--kept) 40%, var(--line)); margin-top: 8px; }

/* Edit day: a tile the same height as the dates, always at the end of the row */
.days-row { display: flex; align-items: stretch; gap: 8px; }
.days-row .date-strip { flex: 1; min-width: 0; margin-right: 0; padding-right: 4px; }
.edit-tile { flex: none; align-self: flex-start; width: 78px; height: 62px; margin-top: 2px; display: grid; place-items: center; align-content: center; gap: 2px; padding: 8px 4px 7px; border-radius: 14px; border: 0; font: inherit; cursor: pointer;
  background: linear-gradient(135deg, #FF9F6B 0%, #F2557A 100%); color: #fff; box-shadow: 0 6px 14px -6px color-mix(in srgb, #F2557A 70%, transparent); }
.edit-tile span { font-size: 1.15rem; line-height: 1.2; }
.edit-tile b { font-size: .78rem; }
.edit-tile.on { background: var(--kept); box-shadow: none; }

/* Messages */
.msg-btn { position: relative; }
.msg-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #F2557A; color: #fff; font-size: .68rem; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.chat-list { display: grid; gap: 2px; margin-top: 10px; border-radius: 16px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.chat-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.chat-row:last-child { border-bottom: 0; }
.people-list .chat-row { background: var(--card); border-radius: 14px; border: 0; box-shadow: var(--shadow); }
.chat-row-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-last { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.unread .chat-last { color: var(--ink); font-weight: 700; }
.msg-count { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #F2557A; color: #fff; font-size: .75rem; font-weight: 800; line-height: 22px; text-align: center; }
.chat-screen { display: flex; flex-direction: column; min-height: calc(100dvh - 70px); padding-bottom: 84px; }
.chat-head { position: sticky; top: var(--topbar-h, 58px); z-index: 3; display: flex; gap: 10px; align-items: center; margin: 0 -16px; padding: 8px 16px 10px; background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.chat-who { flex: 1; display: grid; min-width: 0; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 12px 0; }
.chat-day { align-self: center; margin: 10px 0 4px; font-size: .72rem; font-weight: 700; color: var(--muted); }
.chat-empty { text-align: center; margin: 30px 10px; }
.bubble { max-width: 80%; padding: 9px 12px 6px; border-radius: 18px; font-size: .95rem; line-height: 1.35; }
.bubble p { margin: 0 0 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; background: linear-gradient(135deg, #FF8F6B 0%, #F2557A 100%); color: #fff; border-bottom-right-radius: 6px; }
.bubble.theirs { align-self: flex-start; background: var(--card); color: var(--ink); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.bubble-meta { display: block; text-align: right; font-size: .66rem; opacity: .75; }
.bubble-more { border: 0; background: none; color: inherit; font: inherit; padding: 0 2px; cursor: pointer; }
.share-card { display: flex; gap: 10px; align-items: center; margin: 4px 0; padding: 9px 10px; border-radius: 12px; background: rgb(255 255 255 / 92%); color: #2B1840; text-decoration: none; min-width: 200px; }
.bubble.theirs .share-card { background: var(--soft); color: var(--ink); }
.share-card .ci { font-size: 1.3rem; }
.share-card span:last-child { display: grid; min-width: 0; }
.share-card small { opacity: .7; font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-form { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; gap: 8px; align-items: flex-end; max-width: 720px; margin: 0 auto; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 96%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.chat-form[hidden] { display: none; }
.chat-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; padding: 10px 14px; border-radius: 21px; font: inherit; line-height: 1.3; }
.chat-plus, .chat-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; font-size: 1.2rem; cursor: pointer; }
.chat-plus { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.chat-send { background: linear-gradient(135deg, #FF9F6B 0%, #F2557A 100%); color: #fff; }
.menu-link { display: block; padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }

/* Edit day: an easy-to-spot pill beside "Your days"; the dates get the full width to scroll */
.edit-pill { flex: none; height: 40px; padding: 0 16px; border-radius: 20px; border: 0; font: inherit; font-weight: 800; font-size: .9rem; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #FF9F6B 0%, #F2557A 100%); box-shadow: 0 6px 14px -6px color-mix(in srgb, #F2557A 70%, transparent); }
.edit-pill.on { background: var(--kept); box-shadow: none; }

/* Google and Pinstroll ratings side by side */
.rating-pair { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.rating-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-size: .88rem; }
.rating-chip.pin { background: color-mix(in srgb, #F2557A 12%, var(--card)); }
.pin-mark { color: #F2557A; font-size: 1rem; }

/* Not to be missed */
.must-btn[aria-pressed="true"] { background: linear-gradient(135deg, #FFC86B 0%, #FF9F6B 100%); color: #2B1840; border-color: transparent; font-weight: 800; }
.tl-must { display: inline-block; margin-right: 6px; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #E8A33A; }

/* Small text-style button (sign-in screen) */
.link-btn { background: none; border: 0; padding: 8px; margin-top: 4px; text-decoration: underline; cursor: pointer; color: inherit; font: inherit; }
.link-btn.small { font-size: .85rem; }
