:root {
  --bg: #f7f1e8;
  --bg-header: #fbf6ee;
  --bg-card: #fffdf8;
  --bg-soft: #f7f1e8;
  --accent: #b4574e;
  --accent-hover: #9c4a42;
  --text: #3a3129;
  --text-muted: #8a7d6d;
  --text-faint: #a99b87;
  --text-chip: #4d4338;
  --text-chip-soft: #6b5f51;
  --danger: #a3452f;
  --warn-bg: #f3ead9;
  --warn-border: rgba(160, 120, 60, .3);
  --warn-text: #6b5a3e;
  --theme-bg: #f1e6d6;
  --theme-text: #8a7159;
  --dest-dot: #7a648c;
  --match-bg: #fdf6f5;
  --cd-upcoming-bg: #f6e0dc;
  --cd-now-bg: #e5f1e3;
  --cd-now-text: #4a7a45;
  --cd-done-bg: #eee7db;
  --serif: 'Cormorant Garamond', serif;
  --sans: Karla, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

::placeholder { color: #b5a894; }

button, input, select { font-family: var(--sans); }

@keyframes vmPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes vmFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes vmHeartbeat { 0%, 28%, 100% { transform: scale(1); } 10% { transform: scale(1.22); } 20% { transform: scale(1.08); } }

a { color: inherit; }

button { transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .08s ease; }
button:active { transform: scale(.96); }
.trip-card, .idea-card, .dest-card { transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
#app > * { animation: vmFadeIn .25s ease; }

.boot-loader { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.boot-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff7f0;
  display: flex; align-items: center; justify-content: center; font-family: var(--serif);
  font-size: 15px; font-weight: 600; opacity: .5; animation: vmPulse 1.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- header ---------- */
.header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; padding: 18px 28px;
  border-bottom: 1px solid rgba(58, 49, 41, .09); background: var(--bg-header);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff7f0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 15px; font-weight: 600; letter-spacing: .02em;
}
.brand-name { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.05; }
.brand-tagline { font-size: 11.5px; color: var(--text-muted); letter-spacing: .04em; }
.reacting-as { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reacting-as-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--text-muted);
}

/* ---------- pill chip (toggles, filters) ---------- */
.chip {
  padding: 8px 15px; border-radius: 999px; cursor: pointer;
  font: 600 12.5px var(--sans); border: 1px solid rgba(58, 49, 41, .16);
  background: transparent; color: #6b5f51;
}
.chip.active { border-color: var(--accent); background: var(--accent); color: #fff7f0; }
.chip:hover:not(.active) { background: #f1e8da; }
.chip.fixed-identity { cursor: default; }
.heart-suffix { display: inline-block; animation: vmHeartbeat 2.6s ease-in-out infinite; }

.pill-btn {
  padding: 7px 14px; border: 1px solid rgba(58, 49, 41, .16); border-radius: 999px;
  background: transparent; color: #6b5f51; font: 600 12px var(--sans); cursor: pointer;
}
.pill-btn:hover { background: #f1e8da; }
.pill-btn-danger {
  border: 1px solid rgba(163, 69, 47, .35); color: var(--danger); background: transparent;
  border-radius: 999px; font: 600 11.5px var(--sans); cursor: pointer; padding: 7px 12px;
}
.pill-btn-danger:hover { background: #f6e3dd; }
.pill-btn-outline {
  border: 1px solid var(--accent); color: var(--accent); background: transparent;
  border-radius: 999px; font: 600 11.5px var(--sans); cursor: pointer; padding: 7px 14px;
}
.pill-btn-outline:hover { background: #f6e6e3; }
.btn-solid {
  border: none; border-radius: 999px; background: var(--accent); color: #fff7f0;
  font: 600 13px var(--sans); cursor: pointer; padding: 10px 18px;
}
.btn-solid:hover { background: var(--accent-hover); }
.btn-solid:disabled { opacity: .6; cursor: default; }

/* ---------- form inputs ---------- */
.input {
  padding: 9px 12px; border: 1px solid rgba(58, 49, 41, .18); border-radius: 10px;
  background: var(--bg-card); font: 400 13.5px var(--sans); color: var(--text);
}
.input:focus { outline: 2px solid rgba(180, 87, 78, .35); outline-offset: 1px; }

/* ---------- home ---------- */
.container-home { max-width: 1080px; margin: 0 auto; padding: 34px 28px 90px; }
.proto-banner {
  background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 14px;
  padding: 13px 18px; font-size: 12.5px; line-height: 1.6; color: var(--warn-text); margin-bottom: 22px;
}
.h1 { font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1.1; margin-bottom: 6px; }
.subhead { font-size: 14px; color: var(--text-muted); margin-bottom: 22px; }
.toggle-row { display: flex; gap: 8px; margin-bottom: 20px; }

.trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.trip-card {
  cursor: pointer; background: var(--bg-card); border: 1px solid rgba(58, 49, 41, .1); border-radius: 16px;
  padding: 22px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 1px 3px rgba(58, 49, 41, .05);
  transition: border-color .15s, box-shadow .15s;
}
.trip-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(180, 87, 78, .13); }
.trip-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trip-dates { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.countdown-pill { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.countdown-pill.trip-detail { font-size: 11px; }
.trip-route { font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.15; }
.trip-description { font-size: 12.5px; line-height: 1.5; color: var(--text-chip-soft); }
.trip-meta { font-size: 12.5px; color: var(--text-muted); }

.new-trip-card {
  background: transparent; border: 1.5px dashed rgba(58, 49, 41, .22); border-radius: 16px;
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
}
.new-trip-header { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.new-trip-dates { display: flex; gap: 8px; }
.new-trip-dates .input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 12.5px; }
.err-text { font-size: 12px; color: var(--danger); }
.archive-empty { font-size: 13.5px; color: var(--text-muted); padding: 24px 0; }

/* ---------- trip detail ---------- */
.container-trip { max-width: 820px; margin: 0 auto; padding: 26px 28px 90px; }
.trip-header-row { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin: 18px 0 4px; }
.trip-title { font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1.05; }
.trip-detail-description { font-size: 13.5px; line-height: 1.5; color: var(--text-chip-soft); margin-top: 6px; max-width: 520px; }
.trip-range-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.trip-range-label { font-size: 13px; font-weight: 600; color: var(--accent); }
.trip-date-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trip-date-controls .input { padding: 7px 10px; font-size: 12.5px; min-width: 0; }

.weather-chip {
  font: 500 11.5px var(--sans); color: var(--text-chip-soft); background: var(--bg-card);
  border: 1px solid rgba(58, 49, 41, .1); border-radius: 999px; padding: 4px 11px; white-space: nowrap;
}
.weather-chip b { color: var(--text); font-weight: 700; }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 16px; }

.inline-panel {
  background: var(--bg-card); border: 1px solid rgba(58, 49, 41, .14); border-radius: 16px;
  padding: 18px; margin-bottom: 16px;
}
.inline-panel-title { font-family: var(--serif); font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.mode-chip-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.form-grid .input, .form-grid select { width: 100%; padding: 9px 10px; font-size: 13px; }
.dest-add-row { display: flex; gap: 10px; flex-wrap: wrap; }
.dest-add-row .input { flex: 1; min-width: 220px; padding: 11px 14px; font-size: 14px; border-radius: 12px; }

.add-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 24px; }
.timeline-spine {
  position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(rgba(58, 49, 41, .16), rgba(58, 49, 41, .04));
}
.timeline-item { position: relative; margin-bottom: 14px; }
.date-header {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
  margin: 10px 0 10px -24px; padding-left: 24px;
}
.timeline-empty { font-size: 13.5px; color: var(--text-muted); padding: 12px 0; }

/* hover-to-add gap between (and before) timeline items */
.timeline-gap { position: relative; height: 12px; }
.gap-line {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  height: 1px; background: rgba(58, 49, 41, .14);
}
.gap-controls {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; gap: 6px; opacity: 0; transition: opacity .15s ease; z-index: 2;
}
.timeline-gap:hover .gap-controls, .timeline-gap.open .gap-controls { opacity: 1; }
.gap-add-btn {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  border: 1px dashed rgba(180, 87, 78, .45); background: var(--bg-card); color: var(--accent); cursor: pointer;
}
.gap-add-btn:hover { background: #f6e6e3; border-style: solid; }
.timeline-gap.open { height: auto; padding: 8px 0 2px; }
.timeline-gap.open .gap-line { display: none; }
.timeline-gap.open .gap-controls { position: static; transform: none; opacity: 1; margin-bottom: 8px; }

/* travel leg */
.leg-dot {
  position: absolute; left: -24px; top: 14px; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--bg); background: var(--accent);
}
.leg-row {
  cursor: pointer; background: var(--bg-header); border: 1px solid rgba(180, 87, 78, .2); border-radius: 11px;
  padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.leg-row:hover { border-color: var(--accent); }
.leg-row.expanded { border-radius: 11px 11px 0 0; border-bottom-color: transparent; }
.leg-mode-icon { font-size: 15px; }
.leg-dir { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.leg-title { font: 600 14px var(--sans); }
.leg-spacer { flex: 1; }
.leg-expand-glyph { font-size: 13px; color: var(--text-muted); }
.leg-expanded {
  background: var(--bg-card); border: 1px solid rgba(58, 49, 41, .1); border-top: none;
  border-radius: 0 0 11px 11px; padding: 14px 16px; margin-top: -1px;
  display: flex; flex-direction: column; gap: 12px;
}
.leg-times-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.leg-times { font-size: 13px; color: var(--text-chip-soft); }
.remove-btn { border: none; background: transparent; color: var(--danger); font: 600 12px var(--sans); cursor: pointer; padding: 4px 8px; }

/* new badge */
.new-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .07em; padding: 2px 7px; border-radius: 999px;
  background: var(--accent); color: #fff7f0; text-transform: uppercase;
}

/* destination */
.dest-dot {
  position: absolute; left: -27px; top: 16px; width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid var(--bg); background: var(--dest-dot);
}
.dest-card {
  background: var(--bg-card); border: 1px solid rgba(58, 49, 41, .12); border-radius: 16px;
  padding: 18px 20px; box-shadow: 0 1px 4px rgba(58, 49, 41, .05);
}
.dest-header {
  cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.dest-icon { font-size: 15px; }
.dest-title { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.match-badge { font-size: 11.5px; font-weight: 700; color: var(--accent); }
.idea-count { font-size: 12px; color: var(--text-muted); }
.dest-teaser {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; animation: vmFadeIn .25s ease;
}
.wiki-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.dest-teaser-text { font-size: 12.5px; line-height: 1.5; color: var(--text-chip-soft); }
.dest-expanded {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(58, 49, 41, .08);
  display: flex; flex-direction: column; gap: 16px;
}
.dest-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* per-item date editor (travel legs + destinations) */
.item-date-wrap { display: inline-flex; align-items: center; gap: 6px; }
.item-date-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
}
.item-date { padding: 5px 8px; font-size: 12px; }
.dest-add-date { min-width: 140px; }

/* stays (hotels) with mini website previews */
.stays-block { display: flex; flex-direction: column; gap: 10px; }
.stays-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.stay-card {
  background: var(--bg-soft); border: 1px solid rgba(58, 49, 41, .08); border-radius: 12px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
}
.stay-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stay-name { font: 600 13px var(--sans); }
.stay-preview {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit;
}
.stay-thumb {
  width: 100%; height: 130px; object-fit: cover; border-radius: 9px;
  border: 1px solid rgba(58, 49, 41, .1); background: var(--bg-card);
}
.stay-desc { font-size: 12px; line-height: 1.5; color: var(--text-chip-soft); }
.stay-link { font: 600 11.5px var(--sans); color: var(--accent); text-decoration: none; align-self: flex-start; }
.stay-link:hover { text-decoration: underline; }
.stay-add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stay-add-name { flex: 1; min-width: 150px; }
.stay-add-url { flex: 1.4; min-width: 180px; }

.ideas-block { border-top: 1px solid rgba(58, 49, 41, .08); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.ideas-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.ideas-empty { font-size: 12.5px; color: var(--text-faint); }

.idea-add-toggle { align-self: flex-start; }

/* idea card */
.idea-card {
  background: var(--bg-soft); border: 1px solid rgba(58, 49, 41, .08); border-radius: 12px;
  padding: 13px; display: flex; flex-direction: column; gap: 8px;
}
.idea-card.match { background: var(--match-bg); border: 1.5px solid var(--accent); }
.idea-top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.idea-title-wrap { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.idea-title { font: 600 15px var(--sans); }
.idea-delete { border: none; background: transparent; color: #c2b5a3; font: 600 13px var(--sans); cursor: pointer; padding: 2px 4px; }
.idea-delete:hover { color: var(--danger); }
.idea-note { font-size: 12.5px; line-height: 1.5; color: var(--text-chip-soft); }
.idea-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.theme-tag {
  font-size: 10px; font-weight: 600; letter-spacing: .05em; padding: 3px 8px; border-radius: 999px;
  background: var(--theme-bg); color: var(--theme-text);
}
.when-picker {
  padding: 4px 7px; border: 1px solid rgba(58, 49, 41, .16); border-radius: 8px;
  background: var(--bg-card); font: 500 11px var(--sans); color: var(--text-chip-soft);
}
.votes-line { font-size: 11px; font-weight: 600; color: var(--text-chip-soft); }
.match-line { display: flex; align-items: center; gap: 6px; }
.match-line-icon { font-size: 15px; display: inline-block; animation: vmHeartbeat 2.6s ease-in-out infinite; }
.match-line-text { font-size: 11.5px; font-weight: 700; color: var(--accent); }
.split-line { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.waiting-line { font-size: 11px; color: var(--text-faint); }
.vote-row { display: none; align-items: center; gap: 6px; }
.idea-card:hover .vote-row { display: flex; }
.vote-btn {
  padding: 5px 11px; border-radius: 999px; cursor: pointer; font-size: 14px; background: transparent;
  border: 1px solid rgba(58, 49, 41, .14);
}
.vote-btn.love-active { border: 1.5px solid var(--accent); background: var(--cd-upcoming-bg); }
.vote-btn.nope-active { border: 1.5px solid var(--text-muted); background: var(--cd-done-bg); }

/* comment thread */
.comment-thread { display: flex; flex-direction: column; gap: 8px; }
.comment-list { display: flex; flex-direction: column; gap: 6px; }
.comment-item {
  font-size: 12px; line-height: 1.5; color: var(--text-chip); background: var(--bg-soft);
  border-radius: 9px; padding: 7px 10px;
}
.comment-author { font-weight: 700; color: var(--accent); }
.comment-input-row { display: flex; gap: 7px; }
.comment-input {
  flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid rgba(58, 49, 41, .16); border-radius: 9px;
  background: var(--bg-card); font: 400 12.5px var(--sans); color: var(--text);
}
.comment-post-btn {
  padding: 7px 13px; border: none; border-radius: 9px; background: var(--accent); color: #fff7f0;
  font: 600 11.5px var(--sans); cursor: pointer;
}
.comment-post-btn:hover { background: var(--accent-hover); }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  background: var(--bg-card); border: 1px solid rgba(58, 49, 41, .12); border-radius: 18px;
  padding: 34px 30px; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 4px 20px rgba(58, 49, 41, .08);
}
.login-avatar {
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff7f0;
  display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 17px;
  font-weight: 600; margin: 0 auto 4px;
}
.login-title { font-family: var(--serif); font-size: 26px; font-weight: 600; text-align: center; }
.login-tagline { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: -8px; letter-spacing: .03em; }
.login-input { padding: 11px 14px; border-radius: 12px; font-size: 14px; }
.login-error { font-size: 12.5px; color: var(--danger); text-align: center; }

@media (max-width: 480px) {
  .header { padding: 14px 16px; }
  .container-home, .container-trip { padding-left: 16px; padding-right: 16px; }
  .h1 { font-size: 30px; }
  .trip-title { font-size: 30px; }
}
