/* Maldives / Sri Lanka trip site. Based on the Phuket checklist's stylesheet (same cards, rows and day plan),
   with a lagoon palette and the parts the shared bring list needs (person switch, add row, edit mode). */
:root {
  --bg: #f3f6f5;
  --card: #ffffff;
  --ink: #17282d;
  --muted: #5f6f74;
  --line: #e1e8e7;
  --accent: #0b7f8a;
  --accent-soft: #dff1f1;
  --sun: #c9701c;
  --done: #9aa7aa;
  --danger: #b3261e;
  --warn-bg: #fff4e3;
  --warn-ink: #7a4a10;
  --box: #c3cfce;
  --shadow: 0 1px 2px rgba(23, 40, 45, .05), 0 6px 18px rgba(23, 40, 45, .06);
  --hero: linear-gradient(135deg, #0b8a8f 0%, #0a6f8c 48%, #1a4372 100%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1719;
    --card: #17242a;
    --ink: #e9f1f1;
    --muted: #97a8ab;
    --line: #26363b;
    --accent: #4fc7cf;
    --accent-soft: #143338;
    --sun: #f2a959;
    --done: #63736f;
    --danger: #ff8a80;
    --warn-bg: #33270f;
    --warn-ink: #f2cf94;
    --box: #46595d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    --hero: linear-gradient(135deg, #0a5f66 0%, #0a4e66 48%, #142f52 100%);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
[hidden] { display: none !important; }

/* Hero */
.hero {
  background: var(--hero);
  color: #fff;
  padding: 34px 16px 64px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  left: -10%; right: -10%; bottom: -1px;
  height: 46px;
  background: var(--bg);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hero-inner { max-width: 640px; margin: 0 auto; position: relative; z-index: 1; }
.eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .35);
  padding: 4px 10px; border-radius: 999px;
}
.hero h1 { font-size: 30px; line-height: 1.15; margin: 12px 0 6px; font-weight: 800; letter-spacing: -.01em; }
.hero p { margin: 0; opacity: .94; font-size: 15px; }

main { max-width: 640px; margin: -34px auto 0; padding: 0 16px 64px; position: relative; z-index: 2; }

/* Link to the other page */
.cta-hero {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding: 13px 16px; border-radius: 16px;
  background: #fff; color: #17282d; text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
}
.cta-hero > span:first-child { font-size: 26px; }
.cta-hero b { display: block; font-size: 16.5px; font-weight: 800; }
.cta-hero small { display: block; font-size: 13px; color: #55666b; margin-top: 1px; }
.cta-hero .arrow { margin-left: auto; font-size: 22px; font-weight: 800; color: #0b7f8a; }
.back { display: inline-block; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; opacity: .95; }

/* Person switch */
.who {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 6px; box-shadow: var(--shadow);
}
.who button {
  margin: 0; border: 0; border-radius: 13px; padding: 10px 8px;
  background: transparent; color: var(--muted);
  font: inherit; font-weight: 800; font-size: 16px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.who button small { font-size: 12px; font-weight: 700; opacity: .85; }
.who button[aria-pressed="true"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .who button[aria-pressed="true"] { color: #06262a; } }

/* Sticky progress */
.progress {
  position: sticky; top: 10px; z-index: 5;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  margin-top: 10px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
}
.progress .meter { flex: 1; height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress .meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sun), var(--accent)); border-radius: 999px; transition: width .35s ease; }
.progress .count { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* Status line + edit switch */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 4px 0; }
.sync { font-size: 12px; font-weight: 700; color: var(--muted); }
.sync.ok { color: var(--accent); }
.sync.warn { color: var(--sun); }
.sync.bad { color: var(--danger); }

button {
  margin: 8px 0 10px; background: transparent;
  border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 8px 14px;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
button:hover { border-color: var(--accent); color: var(--accent); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bar button { margin: 0; padding: 6px 12px; white-space: nowrap; }
body.editing .bar button { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Cards */
section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 8px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}
section h2 {
  font-size: 17px; font-weight: 800; margin: 0 0 6px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
section h2 small {
  font-size: 12px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
section.complete { border-color: var(--accent); }
section.complete h2 small { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { section.complete h2 small { color: #06262a; } }
.empty { font-size: 14px; color: var(--muted); margin: 2px 0 8px; }

/* Checklist rows */
.row { display: flex; align-items: flex-start; gap: 4px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row label {
  flex: 1; min-width: 0;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 4px; margin: 0 -4px;
  cursor: pointer; border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.row label:active { background: var(--accent-soft); }
input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 24px; width: 24px; height: 24px; margin: 0;
  border: 2px solid var(--box); border-radius: 8px;
  display: grid; place-content: center; cursor: pointer;
  background: var(--card);
  transition: background .15s, border-color .15s, transform .1s;
}
input[type=checkbox]:active { transform: scale(.92); }
input[type=checkbox]::after {
  content: ""; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0); margin-top: -2px;
  transition: transform .15s ease;
}
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { transform: rotate(45deg) scale(1); }
.row label span { padding-top: 1px; transition: color .15s; overflow-wrap: anywhere; }
.row input:checked + span { color: var(--done); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.row.pending label span::after { content: " ⏳"; font-size: 12px; }

/* Edit mode: rename and remove */
.row .acts { display: none; gap: 4px; padding-top: 7px; }
body.editing .row .acts { display: flex; }
.row .acts button {
  margin: 0; width: 34px; height: 34px; padding: 0; border-radius: 10px;
  font-size: 15px; line-height: 1; display: grid; place-content: center;
}
.row .acts .del { color: var(--danger); }
.row .acts .del:hover { border-color: var(--danger); }

/* Add an item */
.add { border-top: 1px solid var(--line); padding: 8px 0 4px; }
.add > button {
  margin: 0; border: 0; padding: 8px 4px; border-radius: 10px;
  color: var(--accent); font-size: 14.5px; font-weight: 800;
}
.add form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 4px 0 6px; }
.add input[type=text] {
  min-width: 0; width: 100%;
  font: inherit; font-size: 16px; /* 16px stops iPhone zooming in */
  color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.add input[type=text]:focus { border-color: var(--accent); outline: none; }
.add form button { margin: 0; }
.add form .go { background: var(--accent); border-color: var(--accent); color: #fff; padding: 10px 16px; font-size: 14px; }
@media (prefers-color-scheme: dark) { .add form .go, body.editing .bar button { color: #06262a; } }
.add form .x { width: 38px; height: 38px; padding: 0; font-size: 15px; }
.add .both {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--muted); cursor: pointer; padding: 0 2px;
}
.add .both input { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 6px; }
.add .both input::after { width: 5px; height: 9px; }

/* Notices */
.note { font-size: 14px; color: var(--muted); margin: 4px 0 8px; }
.tip { margin: 8px 0 8px; padding: 9px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13.5px; }
.gate h2 { display: block; }
.gate p { margin: 6px 0 10px; font-size: 15px; }
.gate form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; }
.gate input {
  min-width: 0; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.gate form button { margin: 0; background: var(--accent); border-color: var(--accent); color: #fff; }
.gate form button:disabled { opacity: .6; }
footer button { margin-top: 14px; }
#plan + .sync, #days + .sync { margin: 2px 4px 0; }
.foot-actions { text-align: center; margin-top: 18px; }
footer { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }

/* Day plan */
.days { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.days a {
  flex: 0 0 auto; text-decoration: none; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--muted); box-shadow: var(--shadow);
}
.days a b { display: block; font-size: 15px; color: var(--ink); font-weight: 800; }
.days a.today { border-color: var(--accent); background: var(--accent-soft); }
.leg { margin: 24px 4px 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.day { scroll-margin-top: 10px; }
/* A day with a red glow ("tint": "rose" in the plan) and a label ("badge" in the plan).
   Today's outline still shows on top of the glow. */
.day.tint-rose, .days a.tint-rose {
  --rose-bg: #fde6e8; --rose-line: #efb9be; --rose-wash: rgba(226, 54, 76, .26);
  --rose-glow: rgba(214, 40, 62, .34); --rose-ink: #9c1428; --rose-pill: #f8c9ce;
}
@media (prefers-color-scheme: dark) {
  .day.tint-rose, .days a.tint-rose {
    --rose-bg: #2c171c; --rose-line: #70303a; --rose-wash: rgba(255, 72, 96, .24);
    --rose-glow: rgba(255, 64, 88, .36); --rose-ink: #ffc2c8; --rose-pill: #5c232d;
  }
}
.day.tint-rose {
  background:
    radial-gradient(130% 85% at 100% 0%, var(--rose-wash) 0%, transparent 62%),
    radial-gradient(90% 60% at 0% 100%, var(--rose-wash) 0%, transparent 60%),
    var(--rose-bg);
  border-color: var(--rose-line); --line: var(--rose-line);
  box-shadow: 0 0 0 1px var(--rose-line), 0 0 30px 3px var(--rose-glow);
}
.days a.tint-rose { background: var(--rose-bg); border-color: var(--rose-line); box-shadow: 0 0 0 1px var(--rose-line), 0 2px 7px var(--rose-glow); }
.day-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 12.5px; font-weight: 800; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}
.day.tint-rose .badge { background: var(--rose-pill); color: var(--rose-ink); box-shadow: 0 0 12px var(--rose-glow); }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.day .date { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sun); }
.day h2 { margin-top: 2px; display: block; }
.day h2 .sub { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 1px; }
.status {
  display: inline-block; margin: 2px 0 6px; font-size: 12px; font-weight: 800;
  padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}
.status.open { background: var(--warn-bg); color: var(--warn-ink); }
.stop { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.stop:first-of-type { border-top: 0; }
.stop .time { font-size: 13px; font-weight: 800; color: var(--accent); padding-top: 2px; }
.stop .what { font-size: 15px; min-width: 0; }
.stop .what small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.opt { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; margin-left: 4px; white-space: nowrap; }
.top { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: var(--sun); border-radius: 6px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }
.pin {
  display: inline-block; font-weight: 700; font-size: 13.5px;
  background: var(--accent-soft); color: var(--accent);
  padding: 1px 8px; border-radius: 6px; text-decoration: none;
}
a.pin:hover { text-decoration: underline; }

/* Contacts */
.help .contacts { display: grid; gap: 8px; margin: 6px 0 8px; }
.help .contacts a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px; background: var(--accent-soft);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
}
.help .contacts a b { color: var(--accent); white-space: nowrap; }
.help h3 { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 10px 0 4px; }

@media (max-width: 380px) {
  .hero h1 { font-size: 26px; }
  .stop { grid-template-columns: 56px 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Trip identity (25 Nov): this is the Maldives / Sri Lanka site, not the Phuket one. ----
   A stripe in Sri Lanka's flag colours at the very top, a palm / lighthouse / water-villa drawing in the
   header, and a faint palm-and-wave pattern behind the page. All drawn here; no image files. */
body::before {
  content: ""; display: block; height: 6px;
  background: linear-gradient(90deg, #8d153a 0 46%, #ffbe29 46% 64%, #00534e 64% 82%, #eb7400 82% 100%);
}
body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180' fill='none' stroke='%230b7f8a' stroke-opacity='.075' stroke-width='2' stroke-linecap='round'%3E %3Cpath d='M12 44 q10 -7 20 0 t20 0 t20 0'/%3E%3Cpath d='M98 138 q10 -7 20 0 t20 0 t20 0'/%3E %3Cpath d='M126 58 C118 46 106 44 98 50 M126 58 C122 44 112 36 102 36 M126 58 C128 44 138 38 148 40 M126 58 C136 50 146 54 150 64 M126 58 C123 72 123 84 126 96'/%3E %3Cpath d='M38 132 C32 122 22 120 16 126 M38 132 C35 120 27 114 19 114 M38 132 C40 120 48 116 56 118 M38 132 C46 126 54 130 57 138 M38 132 C36 144 36 152 38 162'/%3E %3C/svg%3E"); background-size: 180px 180px; }
@media (prefers-color-scheme: dark) { body { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180' fill='none' stroke='%234fc7cf' stroke-opacity='.06' stroke-width='2' stroke-linecap='round'%3E %3Cpath d='M12 44 q10 -7 20 0 t20 0 t20 0'/%3E%3Cpath d='M98 138 q10 -7 20 0 t20 0 t20 0'/%3E %3Cpath d='M126 58 C118 46 106 44 98 50 M126 58 C122 44 112 36 102 36 M126 58 C128 44 138 38 148 40 M126 58 C136 50 146 54 150 64 M126 58 C123 72 123 84 126 96'/%3E %3Cpath d='M38 132 C32 122 22 120 16 126 M38 132 C35 120 27 114 19 114 M38 132 C40 120 48 116 56 118 M38 132 C46 126 54 130 57 138 M38 132 C36 144 36 152 38 162'/%3E %3C/svg%3E"); } }
.hero::before {
  content: ""; position: absolute; right: -6px; bottom: 34px;
  width: min(92%, 460px); aspect-ratio: 420 / 230;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 230' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E %3Ccircle cx='318' cy='72' r='42' fill='%23ffd27a' fill-opacity='.22'/%3E %3Cpath fill='%23fff' fill-opacity='.2' d='M352 206 L357 118 H353 V112 H358 V98 H355 L365 86 L375 98 H372 V112 H377 V118 H373 L378 206 Z M326 212 Q365 194 404 212 Z'/%3E %3Cpath stroke='%23fff' stroke-opacity='.26' stroke-width='5' d='M262 208 C258 172 266 142 276 114 M276 114 C254 98 232 100 216 118 M276 114 C262 90 242 80 222 84 M276 114 C274 92 266 78 254 68 M276 114 C284 90 300 80 318 84 M276 114 C298 102 316 108 326 126'/%3E %3Cpath stroke='%23fff' stroke-opacity='.18' stroke-width='4' d='M214 210 C212 184 218 162 226 144 M226 144 C210 132 194 134 182 146 M226 144 C216 126 202 120 188 122 M226 144 C232 126 244 120 258 124 M226 144 C242 136 256 142 262 156'/%3E %3Cpath fill='%23fff' fill-opacity='.16' d='M92 178 L122 154 L152 178 H142 V192 H102 V178 Z'/%3E %3Cpath stroke='%23fff' stroke-opacity='.16' stroke-width='3' d='M106 193 V210 M122 193 V210 M138 193 V210 M144 190 H178'/%3E %3Cpath stroke='%23fff' stroke-width='3' stroke-opacity='.24' d='M0 214 q15 -9 30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0'/%3E %3Cpath stroke='%23fff' stroke-width='3' stroke-opacity='.14' d='M-15 226 q15 -9 30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0 t30 0'/%3E %3C/svg%3E") no-repeat right bottom / contain;
  pointer-events: none;
}
.hero { padding-bottom: 150px; }
.hero h1.trip { font-size: 31px; margin-top: 14px; text-shadow: 0 1px 12px rgba(6, 40, 60, .35); }
.hero h1.trip .sep { opacity: .6; font-weight: 600; margin: 0 2px; }
.hero .eyebrow-row { margin-top: 12px; }
@media (max-width: 380px) { .hero h1.trip { font-size: 26px; } }

/* Delete needs a two-second press (app.js): the button fills up while it is held. */
.row .acts .del { width: auto; min-width: 34px; padding: 0 9px; font-size: 13px; font-weight: 700; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: none; white-space: nowrap; }
.row .acts .del.holding {
  color: #fff; border-color: var(--danger);
  background: linear-gradient(var(--danger), var(--danger)) no-repeat left / 0% 100%;
  animation: holdfill 1s linear forwards;
}
@keyframes holdfill { to { background-size: 100% 100%; } }
