/* Kos (docs/trips.md). The look: flights, the theme and the map after Flighty (dark first, big
   airport codes, a progress line, status pills, glowing arcs on a night map); trips after Wanderlog
   (a cover, a day-by-day plan with a colour per day, numbered markers that match the map's pins). */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020; --surface: #141a2c; --surface-2: #1b2338; --raise: #222c45; --ink: #eef1f8; --muted: #8c96ad; --faint: #5d6782;
  --hairline: rgba(255, 255, 255, .08); --hairline-2: rgba(255, 255, 255, .14); --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --accent: #6b8cff; --accent-ink: #0b1020; --good: #32d074; --warn: #ffb020; --bad: #ff5a4f; --flight: #6b8cff;
  --pill-good: rgba(50, 208, 116, .16); --pill-warn: rgba(255, 176, 32, .16); --pill-bad: rgba(255, 90, 79, .16); --pill-info: rgba(107, 140, 255, .18);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5fa; --surface: #ffffff; --surface-2: #f6f8fc; --raise: #eef1f8; --ink: #11162a; --muted: #5c667c; --faint: #9aa3b5;
  --hairline: #e3e7ef; --hairline-2: #d4dae6; --shadow: 0 10px 30px rgba(20, 30, 60, .10);
  --accent: #3e5ff0; --accent-ink: #ffffff; --flight: #3e5ff0;
  --pill-good: #e2f7ea; --pill-warn: #fff3dc; --pill-bad: #ffe5e3; --pill-info: #e6ecff;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.45 system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100dvh; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); } .center { text-align: center; } .pad { padding: 40px 16px; }
.num, .code, .time { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* the bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
       padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px);
       border-bottom: 1px solid var(--hairline); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: .06em; font-size: 17px; }
.brand img { border-radius: 8px; }
.bar-actions { display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--hairline); background: var(--surface); color: var(--muted); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { color: var(--ink); }
/* the theme button: an airplane window whose shutter is up in light and pulled down in dark */
.win .win-frame { stroke-width: 1.8; }
.win .win-pane { stroke-width: 1.2; }
.win .win-sky { fill: color-mix(in srgb, #6bb7ff 55%, transparent); stroke: none; transition: fill .35s; }
.win .win-shade { fill: currentColor; stroke: none; transition: transform .35s cubic-bezier(.23, 1, .32, 1); }
:root[data-theme="dark"] .win .win-sky { fill: #1b2742; }
:root[data-theme="dark"] .win .win-shade { transform: translateY(11px); }   /* most of the way down */
@media (prefers-reduced-motion: reduce) { .win .win-shade, .win .win-sky { transition: none; } }

main { max-width: 1240px; margin: 0 auto; padding: 16px 16px calc(env(safe-area-inset-bottom) + 96px); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 22px 2px 10px; }
.section-title h2 { font-size: 20px; font-weight: 750; }
.section-title .muted { font-size: 13px; }

/* buttons, pills, forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--hairline-2);
       background: var(--surface); color: var(--ink); font-weight: 650; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.fab { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: calc(env(safe-area-inset-bottom) + 20px); z-index: 30; width: 58px; height: 58px; border-radius: 20px;
       background: var(--accent); color: var(--accent-ink); border: 0; font-size: 28px; font-weight: 400; box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; text-decoration: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.pill.good { background: var(--pill-good); color: var(--good); } .pill.warn { background: var(--pill-warn); color: var(--warn); }
.pill.bad { background: var(--pill-bad); color: var(--bad); } .pill.info { background: var(--pill-info); color: var(--accent); }
.pill.dim { background: var(--surface-2); color: var(--muted); }
.seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--hairline); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 13px; border-radius: 10px; font-weight: 650; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--raise); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.form .wide { grid-column: 1 / -1; }
.form input, .form select, .form textarea, textarea.paste { background: var(--surface-2); border: 1px solid var(--hairline-2); border-radius: 12px; padding: 10px 12px;
  font-size: 15px; text-transform: none; letter-spacing: 0; font-weight: 450; color: var(--ink); min-width: 0; }
.form input:focus, .form select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea.paste { width: 100%; min-height: 140px; resize: vertical; }
.check { flex-direction: row !important; align-items: center; gap: 8px !important; text-transform: none !important; letter-spacing: 0 !important; font-size: 14px !important; color: var(--ink) !important; font-weight: 500 !important; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.err { color: var(--bad); font-size: 13.5px; }
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; padding: 16px; box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset; }

/* Flighty: the flight card */
.flight { position: relative; background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%); border: 1px solid var(--hairline); border-radius: 22px; padding: 16px 18px 14px; overflow: hidden; }
.flight + .flight { margin-top: 12px; }
.flight-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.flight-top .who { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.airline { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; letter-spacing: .02em; }
.route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 10px; margin: 12px 0 4px; }
.route .end { min-width: 0; } .route .end.arr { text-align: right; }
.code { font-size: 42px; line-height: 1; font-weight: 800; letter-spacing: -.03em; }
.city { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.time { font-size: 20px; font-weight: 700; margin-top: 6px; }
.time small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.track { position: relative; height: 2px; width: min(160px, 26vw); margin-bottom: 30px; background: repeating-linear-gradient(90deg, var(--faint) 0 4px, transparent 4px 9px); align-self: center; }
.track .done { position: absolute; left: 0; top: 0; bottom: 0; background: var(--flight); box-shadow: 0 0 10px var(--flight); }
.track .plane { position: absolute; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%) rotate(90deg); color: var(--flight); filter: drop-shadow(0 0 6px var(--flight)); }
.track .dur { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--hairline-2); }
.facts div { min-width: 0; } .facts b { display: block; font-size: 16px; font-weight: 750; }
.facts span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.flight-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.flight.compact { padding: 12px 14px; border-radius: 16px; } .flight.compact .code { font-size: 28px; } .flight.compact .time { font-size: 16px; }
.flight.compact .facts { display: none; }

/* the next flight, at the top of the list */
.hero { margin-top: 6px; }
.hero .flight { border-color: color-mix(in srgb, var(--flight) 35%, var(--hairline)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--flight) 12%, transparent), var(--shadow); }
.countdown { font-size: 13px; font-weight: 700; color: var(--accent); }

/* Wanderlog: trips */
.trips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 18px; }   /* big cards (owner, 2026-11-23); one a row on a phone */
.trip-card { border-radius: 22px; overflow: hidden; background: var(--surface); border: 1px solid var(--hairline); text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.trip-card:hover { border-color: var(--hairline-2); transform: translateY(-1px); transition: transform .15s; }
.cover { position: relative; min-height: 120px; padding: 14px 16px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff;
         background: radial-gradient(120% 140% at 0% 0%, hsl(var(--h) 85% 62%) 0%, hsl(calc(var(--h) + 40) 70% 42%) 55%, hsl(calc(var(--h) + 80) 60% 22%) 100%); }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, .35)); pointer-events: none; }
.cover > * { position: relative; z-index: 1; }
.cover h3 { font-size: 22px; font-weight: 800; text-shadow: 0 1px 8px rgba(0, 0, 0, .25); }
.cover .when { font-size: 13px; font-weight: 600; opacity: .92; }
.trip-card .meta { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px 16px; }
.trip-card .cover { min-height: 200px; padding: 18px 20px; }
.trip-card .cover h3 { font-size: 27px; }
.trip-card .cover .when { font-size: 14px; }
@media (max-width: 480px) { .trip-card .cover { min-height: 180px; } .trip-card .cover h3 { font-size: 24px; } }
.trip-head .cover { min-height: 180px; border-radius: 24px; padding: 20px; }
.trip-name { display: flex; align-items: center; gap: 8px; }
.rename-btn { font: inherit; font-size: 18px; line-height: 1; padding: 4px 8px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .45); background: rgba(0, 0, 0, .25); color: #fff; cursor: pointer; }
.rename-btn:hover { background: rgba(0, 0, 0, .4); }
.rename-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.rename-form input { flex: 1 1 220px; font: inherit; font-size: 22px; font-weight: 800; padding: 6px 10px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .6); background: rgba(0, 0, 0, .3); color: #fff; }
.trip-head .cover h1 { font-size: 30px; font-weight: 850; text-shadow: 0 2px 12px rgba(0, 0, 0, .3); }
.avatars { display: flex; margin-top: 10px; }
.avatars span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; border: 2px solid rgba(255, 255, 255, .85); margin-right: -8px; background: rgba(0, 0, 0, .25); }
/* trip tags (docs/trips.md §18): on the cover they sit on the trip's colour */
.sample-note { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; border-color: var(--accent); }
.trip-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
button.pill { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.cover .pill.dim { background: rgba(0, 0, 0, .28); color: #fff; } .cover .pill.warn { background: rgba(0, 0, 0, .38); color: #ffd98a; }
.cover-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; z-index: 3; }   /* above the title, which spans the cover */
.cover-actions .btn { background: rgba(0, 0, 0, .28); border-color: rgba(255, 255, 255, .25); color: #fff; backdrop-filter: blur(6px); }

/* the trip: plan beside the map (desktop), map above the plan (phone) */
.trip { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 18px; margin-top: 16px; align-items: start; }
.plan { min-width: 0; }
.mapwrap { position: sticky; top: 76px; height: calc(100dvh - 96px); border-radius: 24px; overflow: hidden; border: 1px solid var(--hairline); background: var(--surface-2); }
.map { position: absolute; inset: 0; }
.kind-add { margin: 10px 0 0; font-size: 14px; }
.kind-add a { color: var(--accent); text-decoration: none; font-weight: 600; }
.kind-list .stop:first-child { margin-top: 4px; }
.map-note { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--muted); font-size: 14px; }
@media (max-width: 900px) {
  .trip { grid-template-columns: minmax(0, 1fr); }      /* minmax: a plain 1fr grows to its widest card (a flight's) past the screen */
  .mapwrap { position: relative; top: 0; height: 42vh; min-height: 260px; order: -1; }
}
.tabs { margin: 4px 0 14px; position: sticky; top: 64px; z-index: 5; }

.day { margin-bottom: 18px; position: relative; }
.day-head { display: flex; align-items: center; gap: 10px; padding: 6px 2px 10px 8px; position: sticky; top: 112px; z-index: 4; background: var(--bg); }
.day-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--day); box-shadow: 0 0 0 4px color-mix(in srgb, var(--day) 22%, transparent); }
.day-head h3 { font-size: 16px; font-weight: 800; } .day-head .muted { font-size: 13px; }
.stops { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-left: 38px; }
/* the itinerary's rail: one line from the first day to the last, through each day's heading (which is
   sticky, with a background, so it draws its own piece), in each day's colour, under the dots */
.day::before, .day > .day-head::before { content: ""; position: absolute; left: 13px; width: 2px; background: color-mix(in srgb, var(--day) 35%, transparent); }
.day::before { top: 0; bottom: -18px; }                    /* through the gap to the next day */
.day > .day-head::before { top: 0; bottom: 0; }
.plan .day:first-of-type::before, .plan .day:first-of-type > .day-head::before { top: 20px; }   /* it starts at the first dot */
.plan .day:last-of-type::before { bottom: 0; }
.day-dot { position: relative; z-index: 1; }
.stop { position: relative; min-width: 0; }
.marker { position: absolute; left: -38px; top: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--day); color: #fff; display: grid; place-items: center;
          font-size: 13px; font-weight: 800; border: 2px solid var(--bg); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
/* swipe actions behind a booking card (swipe.js): Google Maps on the left, Edit on the right */
.stop > button.item, .stop > article.flight, .plan > article.flight, .plan > button.item.stay { position: relative; z-index: 1; touch-action: pan-y; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.stop > .dragging, .plan > .dragging { transition: none; }
.kos-swipe { position: absolute; z-index: 0; display: flex; justify-content: space-between; overflow: hidden; border-radius: 16px; }
.kos-swipe > div { display: flex; height: 100%; width: 0; overflow: hidden; transition: width .3s cubic-bezier(.2, .8, .2, 1); }
.kos-swipe.dragging > div { transition: none; }
.kos-swipe[data-side="lead"] .lead, .kos-swipe[data-side="trail"] .trail { width: var(--gap); }
.kos-swipe button { flex: 1 1 0; min-width: 0; border: 0; margin: 0; padding: 0 6px; font: inherit; font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; cursor: pointer; }
.kos-swipe.full .trail button { text-align: left; padding-left: 22px; }
.kos-swipe.full .lead button { text-align: right; padding-right: 22px; }
[data-kos-swipe="maps"] { background: #2f9e44; }
[data-kos-swipe="edit"] { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .stop > button.item, .stop > article.flight, .plan > article.flight, .plan > button.item.stay, .kos-swipe > div { transition: none !important; } }
.check-dates { color: var(--warn); font-weight: 600; }   /* a booking whose times can't be right (§36) */
.file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.file-row .grow { flex: 1 1 200px; min-width: 0; }
.file-row .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.small-check { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.live-line { margin: 2px 0 10px; font-size: 12.5px; color: var(--muted); }
.lookup-cell { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.lookup-cell .muted { font-size: 12.5px; }
.map-credit { position: absolute; left: 10px; bottom: 10px; font-size: 11px; color: var(--muted); background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 2px 6px; border-radius: 6px; }
.map-credit a { color: inherit; }
.item { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; padding: 12px 14px; cursor: pointer; text-align: left; width: 100%; display: block; color: var(--ink); }
.item:hover { border-color: var(--hairline-2); }
.item .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.item .what { font-weight: 700; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .at { font-size: 13px; color: var(--muted); white-space: nowrap; font-weight: 600; }
.item .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.kind { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--day); }
.empty-day { font-size: 13px; color: var(--faint); padding: 4px 0 2px; }

/* bookings waiting, suggestions, spending */
.list { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; }
.row .grow { flex: 1; min-width: 0; } .row .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amt { font-weight: 750; white-space: nowrap; }
.row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.bars { display: grid; gap: 8px; }
.bars .b { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.bars .b i { display: block; height: 10px; border-radius: 6px; background: var(--accent); }
.total { font-size: 34px; font-weight: 850; letter-spacing: -.03em; }
.suggest { margin-top: 10px; padding: 12px; border-radius: 16px; border: 1px dashed var(--hairline-2); }
.suggest-head { margin: 12px 0 -4px; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
/* the Gmail set-up page's phone link (docs/trips.md §17.1): the QR stays dark on white in both themes */
.qr-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.qr-row .grow { flex: 1 1 240px; }
.qr { width: 168px; flex: none; padding: 6px; background: #fff; border-radius: 12px; }
.qr svg { display: block; width: 100%; height: auto; }
.suggest q { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* MapLibre in Kos's colours */
.maplibregl-ctrl-group { background: var(--surface) !important; border: 1px solid var(--hairline) !important; box-shadow: none !important; border-radius: 12px !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--hairline) !important; }
:root[data-theme="dark"] .maplibregl-ctrl-icon { filter: invert(1) brightness(1.4); }
.maplibregl-ctrl-attrib { background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--muted) !important; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
@media (max-width: 560px) {
  .code { font-size: 34px; } .time { font-size: 17px; } .facts { grid-template-columns: repeat(2, 1fr); }
  .flight.compact .code { font-size: 26px; } .flight.compact .time { font-size: 15px; } .flight.compact .track { width: min(110px, 18vw); }
  .flight.compact .end:not(.arr) .time small { display: none; }   /* the day is under the card already; "+1" stays */
  .trip-head .cover h1 { font-size: 25px; } .day-head { top: 104px; } .tabs { top: 58px; }
}
.maplibregl-ctrl-attrib { font-size: 10.5px !important; }
@media (max-width: 560px) { .maplibregl-ctrl-attrib.maplibregl-compact-show { max-width: 70%; } }

/* the trip's summary strip (Wanderlog's Reservations and Budgeting) */
.summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 240px); gap: 12px; margin: 14px 0; }
.summary .card { padding: 14px 16px; }
.summary h3 { margin: 0 0 10px; font-size: 15px; font-weight: 800; }
.sum-kinds { display: flex; flex-wrap: wrap; gap: 4px 2px; }
.sum-kind { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 6px 4px; border-radius: 12px; color: var(--text); text-decoration: none; }
.sum-kind:hover, .sum-kind:focus-visible { background: var(--surface-2); }
.sum-ico { position: relative; display: grid; place-items: center; width: 34px; height: 26px; }
.sum-ico svg { width: 24px; height: 24px; fill: currentColor; }
.sum-n { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.sum-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.sum-mail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hairline); font-size: 13px; }
.sum-mail-note { flex-basis: 100%; margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; }
.sum-mail code { font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 3px 8px; border-radius: 8px; word-break: break-all; }
.sum-amt { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.sum-sub { font-size: 12.5px; margin-top: 2px; }
.sum-more { display: inline-block; margin-top: 6px; font-weight: 750; font-size: 13.5px; color: var(--text); }
@media (max-width: 720px) { .summary { grid-template-columns: 1fr; } .sum-kind { min-width: 0; flex: 1 0 22%; } }

/* Kos on its own: the first screen (docs/trips.md §17.4). Inkling's restraint (a narrow column, a big
   tight headline, plain words, raised pills and one solid button), the icon's saffron and teal as
   accents, and EasyUI's pill navigation for the set-up's steps. Scoped to .welcome. */
.welcome { --kos-teal: #024248; --kos-saffron: #feab0a; --kos-cream: #fcf1dd; max-width: 720px; margin: 0 auto; padding: 8px 4px 0; }
.w-hero { position: relative; isolation: isolate; padding: 28px 0 8px; }   /* the glow is drawn inside it, not under the page */
/* the first screen's lights: one pair (the icon's teal and saffron) in each of three places down the
   page (behind the headline, the sample flight and the set-up), each breathing, out of step with the
   others: brighter and a touch larger, then dimmer and smaller. Each fades out inside its box. */
.w-hero, .w-visual, .w-setup { position: relative; isolation: isolate; --glow-hi: .9; --glow-lo: .38; }
:root[data-theme="light"] :is(.w-hero, .w-visual, .w-setup) { --glow-hi: .7; --glow-lo: .3; }
.w-hero::before, .w-visual::before, .w-setup::before { content: ""; position: absolute; inset: -40px 0; z-index: -1; pointer-events: none; opacity: var(--glow-hi);
  background: radial-gradient(var(--tw) var(--th) at var(--tx) var(--ty), color-mix(in srgb, var(--kos-teal) 80%, transparent), transparent 100%),
              radial-gradient(var(--sw) var(--sh) at var(--sx) var(--sy), color-mix(in srgb, var(--kos-saffron) 42%, transparent), transparent 100%);
  animation: kos-glow var(--glow-t, 6s) ease-in-out var(--glow-d, 0s) infinite; }
/* sizes in px, centres placed so each glow fades out inside its own box (no straight edges) */
.w-hero { --tw: 200px; --th: 150px; --tx: 30%; --ty: 48%; --sw: 160px; --sh: 120px; --sx: 66%; --sy: 30%; --glow-t: 6s; }
.w-visual { --tw: 110px; --th: 120px; --tx: 84%; --ty: 45%; --sw: 150px; --sh: 50px; --sx: 60%; --sy: 84%; --glow-t: 7.5s; --glow-d: -2.5s; }
.w-setup { --tw: 170px; --th: 130px; --tx: 24%; --ty: 52%; --sw: 140px; --sh: 110px; --sx: 70%; --sy: 42%; --glow-t: 6.8s; --glow-d: -4.5s; }
@media (max-width: 640px) {
  .w-hero { --tw: 110px; --th: 120px; --tx: 33%; --sw: 90px; --sh: 90px; --sx: 72%; }
  .w-visual { --tw: 80px; --th: 90px; --tx: 76%; --sw: 100px; --sh: 40px; --sx: 50%; }
  .w-setup { --tw: 100px; --th: 110px; --tx: 30%; --sw: 90px; --sh: 90px; --sx: 72%; }
}
@keyframes kos-glow { 0%, 100% { opacity: var(--glow-hi); transform: scale(1.04); } 50% { opacity: var(--glow-lo); transform: scale(.94); } }
@media (prefers-reduced-motion: reduce) { .w-hero::before, .w-visual::before, .w-setup::before { animation: none; } }
.w-kicker { margin: 0; display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--kos-saffron); }
.w-kicker span { opacity: .65; font-weight: 700; } .w-kicker a { color: inherit; text-decoration: none; border-bottom: 1.5px solid color-mix(in srgb, currentColor 40%, transparent); }
:root[data-theme="light"] .w-kicker { color: #b86f00; }
.welcome h1 { margin: 14px 0 14px; font-size: clamp(36px, 7vw, 54px); line-height: 1.02; font-weight: 750; letter-spacing: -.035em; }
.w-lede { margin: 0; max-width: 34em; font-size: 17px; line-height: 1.55; color: var(--muted); }
.w-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.w-primary { appearance: none; border: 0; cursor: pointer; border-radius: 999px; padding: 12px 22px; font-weight: 750; font-size: 15px;
             background: var(--kos-cream); color: var(--kos-teal); box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset, 0 8px 22px -8px rgba(254, 171, 10, .55);
             transition: transform .15s, box-shadow .15s; }
:root[data-theme="light"] .w-primary { background: var(--kos-teal); color: var(--kos-cream); box-shadow: 0 8px 22px -10px rgba(2, 66, 72, .8); }
.w-primary:hover { transform: translateY(-1px); } .w-primary:active { transform: translateY(0); }
.w-primary:disabled { opacity: .6; cursor: progress; }
.w-pill { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; border: 1px solid var(--hairline-2); background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer;
          border-radius: 999px; padding: 11px 18px 11px 14px; font-weight: 650; font-size: 15px;
          box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 4px 12px -6px rgba(0, 0, 0, .3); transition: box-shadow .15s, transform .15s; }
.w-pill svg { width: 17px; height: 17px; fill: currentColor; opacity: .85; }
.w-pill:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, .14), 0 8px 18px -8px rgba(0, 0, 0, .35); }
.w-primary:focus-visible, .w-pill:focus-visible, .w-tab:focus-visible { outline: 2px solid var(--kos-saffron); outline-offset: 2px; }
.welcome #sampleErr:empty { display: none; }
/* the made-up flight, the page's own card, tilted, with a day of the plan over its corner */
.w-visual { position: relative; margin: 40px 0 8px; padding: 0 0 26px; }
.w-card { transform: rotate(-1.6deg); width: calc(100% - 20px); max-width: 560px; margin-left: 6px; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .35)); }
.w-card .flight { pointer-events: none; } .w-card .flight-foot { display: none; }
.w-day { position: absolute; right: 6%; bottom: 0; transform: rotate(2.2deg); display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px;
         background: var(--surface); border: 1px solid var(--hairline-2); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .5); font-size: 13.5px; }
.w-day span:last-child { color: var(--muted); }
.w-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--kos-saffron); box-shadow: 0 0 0 4px color-mix(in srgb, var(--kos-saffron) 25%, transparent); }
/* the set-up: EasyUI's pill navigation (a track, a thumb that slides to the step) and its panel */
.w-setup { margin-top: 44px; }
.w-setup h2 { margin: 0 0 14px; font-size: 20px; letter-spacing: -.01em; }
.w-tabs { position: relative; display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; border: 1px solid var(--hairline-2);
          background: color-mix(in srgb, var(--bg) 60%, black 10%); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35); max-width: 100%; }
:root[data-theme="light"] .w-tabs { background: var(--raise); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06); }
.w-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: 0; border-radius: 999px; background: var(--ink); pointer-events: none;
           box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.w-thumb[data-ready] { transition: transform .38s cubic-bezier(.23, 1, .32, 1), width .38s cubic-bezier(.23, 1, .32, 1); }
.w-tab { position: relative; z-index: 1; appearance: none; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
         padding: 8px 15px; border-radius: 999px; font-weight: 650; font-size: 14px; color: var(--muted); transition: color .2s; white-space: nowrap; }
.w-tab i { font-style: normal; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 800;
           background: var(--hairline-2); color: inherit; }
.w-tab[aria-selected="true"] { color: var(--bg); } .w-tab[aria-selected="true"] i { background: var(--kos-saffron); color: var(--kos-teal); }
.w-panel { margin-top: 14px; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--hairline); line-height: 1.55; }
.w-panel .actions { margin-top: 10px; }
.w-ways { display: grid; gap: 10px; margin-top: 10px; }
.w-way { display: inline-block; margin-right: 6px; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
         background: color-mix(in srgb, var(--kos-saffron) 16%, transparent); color: var(--kos-saffron); }
:root[data-theme="light"] .w-way { color: #9a5d00; }
.w-lede b { color: var(--ink); font-weight: 650; }
.w-support { margin-top: 48px; } .w-support p { margin: 0; color: var(--muted); } .w-support .w-cta { margin-top: 12px; }
.w-support .w-pill svg { color: var(--kos-saffron); opacity: 1; }
.w-foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 13px; line-height: 1.6; }
main:has(> .welcome) { padding-bottom: calc(env(safe-area-inset-bottom) + 14px); }   /* no + button here: no room kept for it */
.w-copy { margin: 28px 0 0; text-align: center; font-size: 12.5px; color: var(--faint); }
.w-foot a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--hairline-2); text-underline-offset: 3px; }
@media (max-width: 640px) {
  .welcome h1 { margin-top: 12px; }
  .w-cta .w-pill { padding: 11px 12px; font-size: 14px; gap: 6px; }
  .w-card .flight { padding: 14px; } .w-card .flight .time { white-space: nowrap; }
  .w-visual { padding-bottom: 0; }
  .w-day { position: relative; right: auto; bottom: auto; display: flex; width: fit-content; max-width: 100%; margin: -12px 0 0 auto; }
  .w-lede { font-size: 16px; }
  .w-cta .w-primary { flex: 1 0 100%; }
  .w-cta .w-pill { flex: 1 1 0; justify-content: center; }
  .w-tabs { display: flex; width: 100%; }
  .w-tab { flex: 1 1 0; justify-content: center; min-width: 0; padding: 8px 4px; gap: 5px; font-size: 13px; }
  .w-day { right: 2%; }
}
@media (prefers-reduced-motion: reduce) { .w-thumb[data-ready], .w-primary, .w-pill { transition: none; } }
.lock-later { margin-top: 18px; }


/* the trip journal (docs/trips.md §20) */
.j-ready { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; color: var(--ink); text-decoration: none; border-color: var(--accent); }
.journal { max-width: 860px; margin: 0 auto; }
.j-hero { position: relative; border-radius: 22px; overflow: hidden; padding: 22px 20px 18px; color: #fff; margin-bottom: 16px;
          background: radial-gradient(120% 140% at 0% 0%, hsl(var(--h) 85% 62%) 0%, hsl(calc(var(--h) + 40) 70% 42%) 55%, hsl(calc(var(--h) + 80) 60% 22%) 100%); }
.j-kicker { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.j-hero h1 { margin: 4px 0 2px; font-size: 32px; letter-spacing: -.02em; }
.j-hero .when { opacity: .9; font-weight: 650; }
.j-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; }
.j-stat { display: flex; flex-direction: column; } .j-stat b { font-size: 22px; font-weight: 800; } .j-stat span { font-size: 12px; opacity: .85; }
.j-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.j-actions .btn { background: rgba(0, 0, 0, .28); color: #fff; border-color: rgba(255, 255, 255, .35); }
.j-map { position: relative; height: 380px; border-radius: 18px; overflow: hidden; margin: 14px 0 4px; background: var(--surface-2); border: 1px solid var(--hairline); }
.j-credit { font-size: 11px; margin: 0 0 22px; } .j-credit a { color: inherit; }
.j-day { margin: 0 0 22px; }
.j-day .day-head { position: static; }
.j-lines { margin: 0 0 8px 26px; padding: 0; display: grid; gap: 4px; }
.j-lines li { line-height: 1.45; }
.j-free { margin: 0 0 8px 26px; }
.j-spend { margin: 0 0 8px 26px; font-size: 13px; } .j-spend:empty { display: none; }
.j-note { position: relative; margin: 0 0 8px 26px; }
.journal > .j-note { margin-left: 0; }
.j-text { width: 100%; box-sizing: border-box; resize: none; overflow: hidden; font: inherit; line-height: 1.5; color: var(--ink); background: var(--surface); border: 1px dashed var(--hairline-2); border-radius: 12px; padding: 10px 12px; }
.j-text:focus { outline: none; border-style: solid; border-color: var(--accent); }
.j-saved { position: absolute; right: 10px; bottom: -18px; font-size: 11.5px; }
@media (max-width: 720px) { .j-map { height: 300px; } .j-hero h1 { font-size: 26px; } }
@media print {
  header.bar, .fab, .j-actions, .j-saved, .maplibregl-control-container { display: none !important; }
  body { background: #fff; color: #000; }
  .journal { max-width: none; }
  .j-hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .j-day { break-inside: avoid; }
  .j-text { border: 0; padding: 0; background: none; color: #000; }
  .j-text:placeholder-shown { display: none; }
}

/* the trip's Lodging tab: its stays, as cards; the map zooms in on them */
.item.stay { display: block; width: 100%; text-align: left; margin-bottom: 10px; }
.item.stay .row1 { align-items: center; }
.stay-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 4px; }
.stay-dates span { display: block; font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stay-dates b { font-size: 15px; } .stay-dates small { margin-left: 6px; color: var(--muted); }

/* a trip's city photo on its cover (Wikimedia, with its credit): the scrim keeps the title readable */
.cover.has-photo { background-size: cover; background-position: center; }
.photo-credit { position: absolute; right: 10px; bottom: 6px; z-index: 2; max-width: 70%; font-size: 10px; line-height: 1.3; color: rgba(255, 255, 255, .78);
                text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
a.photo-credit:hover { color: #fff; text-decoration: underline; }

/* the backup reminder (Kos on its own): short-lived, it fades out by itself */
.backup-note { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; border-color: var(--warn); transition: opacity .4s, transform .4s; }
.backup-note.leaving { opacity: 0; transform: translateY(-6px); }

/* a place to go on a day: the link under a day, and the place form's hint */
.add-place { display: inline-block; font-size: 13px; font-weight: 650; color: var(--accent); text-decoration: none; padding: 2px 0; }
.add-place:hover { text-decoration: underline; }
.stops > .add-place { margin-top: -2px; }
.where-hint { font-size: 13px; line-height: 1.45; min-height: 1.4em; } .where-hint .good { color: var(--good); font-weight: 650; }

/* "Send to the Kos developers": a quiet line under a trip's plan */
.report-line { font-size: 12.5px; margin: 18px 0 4px; }
.report-why { display: grid; gap: 8px; } .report-why .check { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
.linklike { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }


/* New trip: paste a shared trip's link instead (docs/trips.md §23) */
.shared-paste { margin-bottom: 12px; font-size: 14px; }
.shared-row { display: flex; gap: 8px; margin-top: 10px; }
.shared-row input { flex: 1; min-width: 0; }
.shared-paste .err:empty { display: none; }
.shared-paste .err { display: block; margin-top: 6px; }

/* A shared trip's preview (docs/trips.md §23): the trip as it would look, Add at the top */
.share-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-bottom: 12px; }
.share-bar .actions { margin-top: 0; }
.share-count { margin: 10px 2px 4px; font-size: 13px; }
.preview .day-head { top: 64px; }

/* Standalone Kos's trip list ends like its first screen: support, other projects, © (the same classes) */
.kos-foot { --kos-saffron: #feab0a; margin-top: 56px; }
.kos-foot .w-support { margin-top: 0; }
.kos-foot .w-copy { margin-top: 20px; }
.w-support p b { color: var(--ink); font-weight: 650; }

/* K2: the trip's Immich album and each day's photos (docs/trips.md §25) */
.j-photos { margin: 0 0 22px; }
.j-photos-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px 12px; }
@media (max-width: 640px) { .j-photos-row { grid-template-columns: 38px 1fr; } .j-photos-act { grid-column: 1 / -1; } }
.j-cam { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); color: var(--accent); flex: none; }
.j-photos-act { display: flex; gap: 8px; flex-wrap: wrap; }
.j-photos-err { margin: 10px 0 0; font-size: 13px; }
.j-strip { display: flex; gap: 6px; margin: 0 0 10px 26px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.j-strip::-webkit-scrollbar { display: none; }
.j-thumb { position: relative; flex: none; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-weight: 750; text-decoration: none; }
.j-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.j-video { position: absolute; right: 5px; bottom: 4px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.j-more { border: 1px dashed var(--hairline-2); background: transparent; }
@media print { .j-photos-act, .j-photos .btn { display: none; } .j-strip { flex-wrap: wrap; overflow: visible; } }
#jSpent:empty { display: none; }

/* Bills from Gmail (docs/bills.md): each bill's email or PDF under it */
.bill-src { display: block; font-size: 13px; }
.auto-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; border-color: var(--accent); }
.fit-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; border-color: var(--accent); }

/* the header's Check Gmail: a lighthouse (Kos's harbour light), in the accent colour; its beams flash
   while it checks */
.icon-btn.mail-check { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--hairline)); width: auto; display: inline-flex; align-items: center;
  gap: 6px; padding: 0 8px 0 12px; font-family: inherit; font-size: 13px; font-weight: 650; line-height: 1; white-space: nowrap; }
@media (max-width: 480px) { .mail-check-more { display: none; } }              /* a phone: "Check Gmail" */
/* a narrow phone on a Minty (four buttons): a tighter button, and the logo without the word */
@media (max-width: 400px) {
  .icon-btn.mail-check { gap: 4px; padding: 0 6px 0 10px; font-size: 12.5px; }
  .icon-btn.mail-check svg { width: 22px; height: 22px; }
  .bar:has(#mintyLink:not([hidden])) .brand span { display: none; }
}
@media (max-width: 340px) { .icon-btn.mail-check { width: 38px; padding: 0; justify-content: center; } .mail-check-text { display: none; } }
.icon-btn.mail-check svg { flex: none; width: 24px; height: 24px; stroke-width: 1.6; }
.icon-btn.mail-check .kos-beam { fill: currentColor; stroke: none; opacity: .28; }
.icon-btn.mail-check .kos-lamp { fill: currentColor; stroke: none; opacity: .55; }
.icon-btn.mail-check.busy .kos-beam, .icon-btn.mail-check.busy .kos-lamp { animation: kos-beam 1s ease-in-out infinite; }
@keyframes kos-beam { 50% { opacity: .05; } }
@media (prefers-reduced-motion: reduce) { .icon-btn.mail-check.busy .kos-beam { animation: none; opacity: .4; } }
