:root {
  --ink: #1c1915;
  --muted: #6d6256;
  --sand: #f3eadc;
  --paper: #fffaf3;
  --sea: #143e3b;
  --sea-2: #1f5c57;
  --coral: #d4654a;
  --line: #e4d7c4;
  --shadow: 0 18px 50px rgba(48, 32, 16, 0.08);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(20, 62, 59, 0.16), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(212, 101, 74, 0.16), transparent 50%),
    var(--sand);
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sea-2); }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}
.gate-card {
  width: min(460px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 36px 32px 28px;
}
.kicker {
  margin: 0 0 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--coral);
  font-weight: 600;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; }
.gate-card h1 { margin: 0; font-size: 58px; line-height: 0.9; }
.lede { color: var(--muted); line-height: 1.5; margin: 14px 0 22px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 13px;
  outline: none;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--sea-2); box-shadow: 0 0 0 3px rgba(31, 92, 87, 0.15); }
.check { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; font-weight: 500; color: var(--muted); }
.check input { width: auto; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--sea);
  color: #f6f1e7;
  font-weight: 600;
}
.btn:hover { background: var(--sea-2); }
.btn.secondary { background: transparent; color: var(--sea); border: 1px solid var(--line); }
.btn.secondary:hover { background: #fff; }
.btn.danger { background: transparent; color: #9c3b28; border: 1px solid #f0cfc6; }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn-row, .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.full { width: 100%; margin-top: 16px; }
.error {
  background: #fde8e2;
  color: #8a341f;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
}
.page { width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 48px; }
.board-page { width: calc(100% - 16px); max-width: 1500px; padding: 10px 0 12px; }
.mast.compact { padding: 14px 18px; border-radius: 18px; align-items: center; }
.mast.compact h1 { font-size: 36px; }
.people.light { margin-top: 8px; }
.mast .person { background: transparent; color: #f6f1e7; border-color: rgba(255,250,243,.35); }
.invite-inline {
  width: min(280px, 46vw);
  background: transparent;
  color: #f6f1e7;
  border-color: rgba(255,250,243,.3);
  padding: 8px 10px;
  font-size: 12px;
}
.board {
  display: grid;
  grid-template-columns: 250px minmax(0, 1.15fr) minmax(320px, 0.95fr);
  gap: 12px;
  margin-top: 12px;
  height: calc(100vh - 118px);
}
.side-col, .plan-col, .map-col { min-height: 0; overflow: auto; }
.map-col { display: flex; flex-direction: column; }
#trip-map { flex: 1; width: 100%; min-height: 420px; border: 0; border-radius: 16px; background: #e7efe8; }
.stay-list { display: flex; flex-direction: column; gap: 8px; margin: 0; border: 0; padding: 0; }
.stay {
  width: 100%;
  text-align: left;
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}
.stay::before { display: none; }
.stay h3 { font-size: 20px; }
.stay-tools { margin-top: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
}
.chip.on { background: var(--sea); color: #f6f1e7; border-color: var(--sea); }
.tag.in { background: #e5f4ee; color: var(--sea); }
.vote-row { margin-top: 8px; }
.btn.yes.on { background: var(--sea-2); }
.btn.no { background: transparent; color: #9c3b28; border: 1px solid #f0cfc6; }
.btn.no.on { background: #9c3b28; color: white; }
.locked {
  background: #e5f4ee;
  color: var(--sea);
  border-radius: 12px;
  padding: 10px 12px;
}
.day.fixed { box-shadow: inset 0 -3px 0 var(--sea-2); }
.mast {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  background: var(--sea);
  color: #f6f1e7;
  border-radius: 28px;
  padding: 26px 28px;
}
.mast h1 { margin: 0; font-size: 54px; font-style: italic; line-height: 0.9; }
.mast .kicker { color: #f0b7a6; }
.mast-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.mast .btn.secondary { color: #f6f1e7; border-color: rgba(255, 250, 243, 0.3); }
.live { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.dot {
  width: 9px; height: 9px; border-radius: 50%; background: #8dceb8;
  box-shadow: 0 0 0 0 rgba(141, 206, 184, 0.7);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(141, 206, 184, 0); }
}
.grid { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: 18px; margin-top: 18px; }
.panel, .map-section {
  background: rgba(255, 250, 243, 0.9);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.panel { padding: 18px; }
.section-head, .map-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.section-head h2, .map-head h2 { margin: 0; font-size: 32px; }
.hint { color: var(--muted); margin: 6px 0 14px; line-height: 1.45; }
.stay-list { display: flex; flex-direction: column; gap: 8px; margin: 0; border: 0; padding: 0; }
.stay, .plan-card, .stop {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}
.stay.selected { border-color: var(--sea-2); box-shadow: 0 0 0 3px rgba(31, 92, 87, 0.12); }
.dates { color: var(--sea); font-weight: 600; font-size: 14px; }
.stay h3, .plan-card h3, .stop h3 { margin: 4px 0; font-size: 22px; }
.meta, .quiet { color: var(--muted); margin: 0; font-size: 14px; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 8px 0 14px; }
.day {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  min-width: 74px;
  padding: 8px 10px;
  text-align: left;
}
.day strong { display: block; font-size: 13px; }
.day span { color: var(--muted); font-size: 12px; }
.day.on { background: var(--sea); color: #f6f1e7; border-color: var(--sea); }
.day.on span { color: #d7ebe6; }
.day.has-plan { box-shadow: inset 0 -3px 0 var(--coral); }
.radii { display: flex; gap: 8px; margin-bottom: 12px; }
.radii button { flex: 1; }
.radii .on { background: var(--coral); color: white; }
.timeline { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.stop { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.time { font-weight: 600; color: var(--sea); }
.leaflet-div-icon { background: transparent; border: 0; }
.tag {
  display: inline-block;
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #f4ece1;
  color: var(--muted);
}
.lunch { background: #fff6ea; }
.map-section { margin-top: 18px; padding: 16px; }
.pin {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--coral); border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,.25); display: block;
}
.pin.on { background: var(--sea); }
.pin.num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--sea); color: white; font-size: 12px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid white;
}
.backdrop {
  position: fixed; inset: 0;
  background: rgba(28, 25, 21, 0.46);
  display: grid; place-items: center;
  padding: 18px; z-index: 2000;
}
.modal {
  width: min(640px, 100%);
  max-height: min(92vh, 860px);
  overflow: auto;
  background: var(--paper);
  border-radius: 24px;
  padding: 20px;
}
.geo-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.geo-results button {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
}
#toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: white; border-radius: 999px; padding: 10px 14px;
  opacity: 0; pointer-events: none; transition: 0.2s ease;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { padding: 8px 0 4px; color: var(--muted); }
.people { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.person {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 14px;
}
@media (max-width: 980px) {
  .grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; height: auto; }
  .map-col { min-height: 460px; }
  .mast { flex-direction: column; align-items: flex-start; }
  .mast-actions { align-items: flex-start; }
  .mast h1, .gate-card h1 { font-size: 44px; }
  .mast.compact h1 { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
}
