/* Milebook - warm "travel journal" look. Mobile first; two columns on desktop. */
@font-face { font-family: Fraunces; font-weight: 400; font-display: swap; src: url(../fonts/fraunces-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Fraunces; font-weight: 600; font-display: swap; src: url(../fonts/fraunces-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Fraunces; font-weight: 700; font-display: swap; src: url(../fonts/fraunces-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(../fonts/inter-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Noto Sans Tamil'; font-weight: 400; font-display: swap; src: url(../fonts/noto-sans-tamil-tamil-400-normal.woff2) format('woff2'); unicode-range: U+0B80-0BFF, U+200C-200D, U+25CC; }
@font-face { font-family: 'Noto Sans Tamil'; font-weight: 600; font-display: swap; src: url(../fonts/noto-sans-tamil-tamil-600-normal.woff2) format('woff2'); unicode-range: U+0B80-0BFF, U+200C-200D, U+25CC; }

:root {
  --paper: #FBF7F0; --paper2: #F4EDE1; --card: #FFFFFF; --ink: #1F2A37; --ink2: #4B5563; --mute: #7A7F87; --line: #E7DFD2;
  --teal: #0F766E; --teal2: #0B5F58; --teal-soft: #E3F1EF; --orange: #F97316; --orange-soft: #FFEBDD; --yellow: #FDE68A;
  --green: #16A34A; --red: #DC2626; --red-soft: #FDECEC;
  --shadow: 0 1px 2px rgba(31, 42, 55, .06), 0 6px 18px rgba(31, 42, 55, .06);
  --r: 16px; --head: Fraunces, 'Noto Sans Tamil', Georgia, serif; --body: Inter, 'Noto Sans Tamil', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14181F; --paper2: #1B212A; --card: #1E2530; --ink: #EEF0F3; --ink2: #C3C9D2; --mute: #8C94A0; --line: #2C3542;
    --teal: #2DB3A6; --teal2: #5FD3C7; --teal-soft: #173634; --orange: #FB923C; --orange-soft: #3A2516; --yellow: #8A6D16;
    --green: #34D399; --red: #F87171; --red-soft: #3A1C1C; --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14181F; --paper2: #1B212A; --card: #1E2530; --ink: #EEF0F3; --ink2: #C3C9D2; --mute: #8C94A0; --line: #2C3542;
  --teal: #2DB3A6; --teal2: #5FD3C7; --teal-soft: #173634; --orange: #FB923C; --orange-soft: #3A2516; --yellow: #8A6D16;
  --green: #34D399; --red: #F87171; --red-soft: #3A1C1C; --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { overflow-x: hidden; margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--body); }
body { min-height: 100vh; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 28px; line-height: 1.15; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 6px 0; } a { color: var(--teal); }
[hidden] { display: none !important; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--mute); } .small { font-size: 13px; } .tamil { font-family: 'Noto Sans Tamil', var(--body); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* buttons & fields (touch targets >= 48 px) */
button { font: inherit; color: inherit; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent; font-weight: 600; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { background: var(--teal); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--teal2); }
.btn.accent { background: var(--orange); color: #fff; }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn.text { background: none; color: var(--teal); padding: 0 10px; }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.iconbtn { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px; border: 0; background: none; color: var(--ink); }
.iconbtn:hover { background: var(--paper2); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink2); }
.field small { color: var(--mute); font-size: 12px; }
input, select, textarea { min-width: 0; max-width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-height: 48px; padding: 10px 14px; width: 100%; outline: none; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.row { display: flex; gap: 10px; align-items: center; } .row > * { min-width: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.grid3 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) 68px; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--teal); }
.err { background: var(--red-soft); color: var(--red); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 0 0 14px; }
.note { background: var(--teal-soft); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 0 0 14px; }

/* layout */
.shell { max-width: 1100px; margin: 0 auto; padding: 0 16px 96px; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); display: flex; align-items: center; gap: 6px; min-height: 60px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.topbar .title { flex: 1; min-width: 0; font-family: var(--head); font-weight: 600; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: 700; font-size: 22px; padding-left: 8px; flex: 1; }
.brand img { width: 34px; height: 34px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.section { margin: 18px 0; }
.section > h2 { margin-bottom: 10px; }
.empty { text-align: center; padding: 40px 16px; color: var(--ink2); }
.empty img, .empty svg.big { width: 120px; height: 120px; margin-bottom: 8px; }
.center { display: flex; align-items: center; justify-content: center; min-height: 50vh; flex-direction: column; gap: 12px; }
.spin { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--teal-soft), transparent 60%), var(--paper); }
.auth .box { width: 100%; max-width: 420px; }
.auth .logo { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 22px; }
.auth .logo img { width: 72px; height: 72px; }
.auth .logo h1 { font-size: 34px; margin-top: 6px; }
.auth .logo p { color: var(--ink2); font-family: var(--head); font-style: italic; }
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper2); border-radius: 14px; padding: 4px; margin-bottom: 16px; }
.tabs2 button { border: 0; background: none; min-height: 42px; border-radius: 11px; font-weight: 600; color: var(--ink2); }
.tabs2 button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.or { display: flex; align-items: center; gap: 10px; color: var(--mute); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* trips home */
.trips { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.tripcard { position: relative; display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.tripcard .cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--teal) 0%, #14B8A6 55%, var(--orange) 140%); position: relative; }
.tripcard .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tripcard .cover .route { position: absolute; inset: 0; opacity: .25; }
.tripcard .body { padding: 14px 16px 16px; }
.tripcard h2 { font-size: 21px; margin-bottom: 2px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--paper2); color: var(--ink2); }
.badge.later { background: var(--orange-soft); color: var(--orange); }
.badge.now { background: var(--teal); color: #fff; }
.badge.done { background: var(--paper2); color: var(--mute); }
.tripcard .badge { position: absolute; top: 12px; left: 12px; background: rgba(255, 255, 255, .92); color: var(--ink); }
.tripcard .badge.now { background: var(--teal); color: #fff; }
.avatars { display: flex; margin-top: 10px; }
.av { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; border: 2px solid var(--card); margin-left: -8px; flex: none; }
.avatars .av:first-child { margin-left: 0; }
.av.lg { width: 44px; height: 44px; font-size: 16px; margin: 0; }
.newtrip { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; min-height: 220px; border: 2px dashed var(--line); border-radius: 20px; color: var(--teal); font-weight: 700; background: none; }
.fab { position: fixed; right: 18px; bottom: 22px; z-index: 30; box-shadow: 0 8px 24px rgba(15, 118, 110, .35); border-radius: 18px; }

/* wizard */
.steps { display: flex; gap: 6px; margin: 14px 0 18px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--teal); }
.wizfoot { position: sticky; bottom: 0; z-index: 5; background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 0 16px; display: flex; gap: 10px; }
.wizfoot .btn { flex: 1; }
.memrow { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: var(--card); }
.memrow .row { justify-content: space-between; }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.modes button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 68px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 12px; font-weight: 600; color: var(--ink2); }
.modes button .em { font-size: 22px; line-height: 1; }
.modes button.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; min-height: 38px; padding: 0 14px; font-size: 14px; }
.chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.filepick { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; min-height: 52px; }
.filepick .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

/* trip */
.triphead { padding: 16px 0 4px; }
.triphead .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--ink2); font-size: 14px; margin-top: 6px; }
.ttabs { position: sticky; top: 60px; z-index: 15; display: flex; gap: 4px; overflow-x: auto; background: var(--paper); padding: 8px 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.ttabs::-webkit-scrollbar { display: none; }
.ttabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: 12px; text-decoration: none; color: var(--ink2); font-weight: 600; font-size: 14px; }
.ttabs a.on { background: var(--teal); color: #fff; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-height: 64px; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 600; } .item .s { color: var(--mute); font-size: 13px; }
.role { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--paper2); color: var(--ink2); text-transform: capitalize; }
.role.owner { background: var(--orange-soft); color: var(--orange); }
.role.editor { background: var(--teal-soft); color: var(--teal); }
.day { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.day .dh { display: flex; align-items: baseline; gap: 10px; }
.day .dn { font-family: var(--head); font-size: 13px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .05em; }
.leg { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--teal-soft); margin-top: 8px; font-size: 14px; }
.leg .em { font-size: 20px; }
.soon { border: 1px dashed var(--line); border-radius: 16px; padding: 28px 16px; text-align: center; color: var(--ink2); }

/* sheet (bottom on phones, centred on desktop) + toast */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(15, 20, 28, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet .panel { background: var(--paper); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 16px 22px; }
.sheet .panel h2 { margin-bottom: 12px; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: -6px auto 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 14px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 70; background: var(--orange); color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 4px; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; font-size: 13px; word-break: break-all; }
.linkbox code { flex: 1; }

@media (min-width: 760px) {
  .sheet { align-items: center; }
  .sheet .panel { border-radius: 22px; }
  .shell { padding: 0 24px 60px; }
  h1 { font-size: 34px; }
  .twocol { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
}
.soon svg.big { width: 44px; height: 44px; color: var(--teal); margin-bottom: 6px; }
input[type=datetime-local], input[type=date] { font-size: 14px; padding: 10px 8px; }

/* ---------- stage 2: maps, place search, day timeline ---------- */
.mapwrap { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--paper2); }
.map { position: absolute; inset: 0; }
.mapnote { position: absolute; inset: auto 10px 10px 10px; z-index: 500; background: var(--card); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--ink2); box-shadow: var(--shadow); text-align: center; }
.leaflet-container { font: 13px/1.4 var(--body); background: var(--paper2); }
.leaflet-popup-content b { font-family: var(--head); }
.mpin { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 13px/1 var(--body); color: #fff; background: var(--teal); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.mpin.pin-stay { background: #fff; color: var(--ink); font-size: 15px; border-color: var(--teal); }
.mpin.pin-base { background: var(--ink); }
.mpin.pin-pick { background: none; border: 0; box-shadow: none; font-size: 30px; transform: translateY(-14px); }
.mpin.done { background: var(--green); } .mpin.skipped { background: #9CA3AF; }
.place .row { gap: 6px; }
.pinbtn { flex: none; border: 1px solid var(--line); background: var(--card); }
.pinbtn.on { color: var(--orange); border-color: var(--orange); background: var(--orange-soft); }
.suggest { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 54px; list-style: none; margin: 0; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 280px; overflow: auto; }
.suggest button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 9px; min-height: 48px; }
.suggest button:hover, .suggest button:focus { background: var(--teal-soft); outline: none; }
.suggest small { color: var(--mute); font-size: 12px; }
.iconbtn.sm { width: 40px; height: 40px; border-radius: 11px; }
.iconbtn.on { background: var(--teal-soft); color: var(--teal); }
.day .dh { flex-wrap: nowrap; align-items: center; gap: 8px; }
.day .dh h3 { flex: 1; min-width: 0; }
.daynote { align-items: center; }
.day.focused { background: linear-gradient(90deg, var(--teal-soft), transparent 70%); border-radius: 12px; padding-left: 8px; }
.wx { font-size: 13px; font-weight: 600; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; white-space: nowrap; }
.wx .rain { color: #2563EB; font-weight: 600; }
.daynote { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; margin: 4px 0 2px; }
.daynote .hl { background: var(--yellow); color: #1F2A37; border-radius: 6px; padding: 0 6px; }
.tl { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tli { display: flex; align-items: center; gap: 8px; }
.tli .leg { flex: 1; margin-top: 0; }
.tli.act { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 8px 4px 4px; min-height: 56px; }
.tli.act.done { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.tli.act.skipped .tt { text-decoration: line-through; color: var(--mute); }
.tli.dragging { box-shadow: 0 8px 20px rgba(0, 0, 0, .18); border-color: var(--teal); }
.tli .handle { touch-action: none; cursor: grab; color: var(--mute); padding: 14px 4px 14px 8px; font-size: 14px; letter-spacing: -2px; user-select: none; }
.tli .num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.tli.done .num { background: var(--green); } .tli.skipped .num { background: #9CA3AF; }
.tbody { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 6px 4px; display: flex; flex-direction: column; color: inherit; }
.tbody .tt { font-weight: 600; }
.tbody .ts { color: var(--mute); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tli .star { color: var(--orange); }
.status { flex: none; border: 0; border-radius: 99px; font-size: 12px; font-weight: 700; padding: 6px 10px; min-height: 32px; background: var(--paper2); color: var(--ink2); }
.status.done { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.status.skipped { background: var(--paper2); color: var(--mute); }
.status:disabled { opacity: 1; cursor: default; }
.stayev, .night { background: var(--orange-soft); border-radius: 12px; padding: 2px 8px 2px 10px; min-height: 52px; }
.stayev .em, .night .em { font-size: 18px; }
.night { min-height: 40px; background: none; border: 1px dashed var(--line); }
.night .ts { color: var(--ink2); font-size: 13px; }
.addrow { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.addrow .btn { padding: 0 8px; }
.planwide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); gap: 28px; align-items: start; }
.mapside { position: sticky; top: 120px; }

/* ---------- stage 3: today, photos, upload queue, viewer ---------- */
.photobtns { display: flex; gap: 10px; flex-wrap: wrap; }
.photobtns.big { margin: 14px 0; }
.photobtns.big .btn { flex: 1; }
.btn.huge { min-height: 64px; font-size: 18px; border-radius: 18px; box-shadow: 0 8px 20px rgba(249, 115, 22, .3); }
.btn.huge svg { width: 26px; height: 26px; }
.daypick { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.daypick .dn { font-family: var(--head); font-size: 13px; font-weight: 700; color: var(--orange); text-transform: uppercase; letter-spacing: .05em; }
.daypick h2 { font-size: 19px; }
.wxcard { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, var(--teal-soft), var(--card)); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.wxcard .big { font-size: 40px; line-height: 1; }
.wxcard .t { font-family: var(--head); font-size: 22px; font-weight: 600; }
.wxcard .t .muted { font-family: var(--body); font-size: 14px; font-weight: 500; }
.titem { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 8px 14px; }
.titem .t { font-weight: 600; } .titem .s { color: var(--mute); font-size: 13px; }
.titem.leg { background: var(--teal-soft); } .titem.stay { background: var(--orange-soft); }
.titem.done { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.titem.skipped .t { text-decoration: line-through; color: var(--mute); }
.titem .nav { padding: 0; min-height: 36px; }
.titem .star { color: var(--orange); }
.ticks { display: flex; flex-direction: column; gap: 6px; }
.tick { min-width: 76px; min-height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--paper); font-weight: 700; font-size: 13px; color: var(--ink2); }
.tick.done.on { background: var(--green); border-color: var(--green); color: #fff; }
.tick.skip.on { background: var(--mute); border-color: var(--mute); color: #fff; }
.tick.star { font-size: 18px; } .tick.star.on { background: var(--yellow); border-color: #E0B93B; color: #8A5A00; }
.queue { background: var(--card); border: 1px dashed var(--teal); border-radius: 14px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.qrow { display: flex; gap: 8px; overflow-x: auto; margin-top: 8px; }
.qitem { width: 72px; flex: none; }
.qitem img, .qitem .ph { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--paper2); }
.qitem .bar { height: 5px; border-radius: 3px; background: var(--line); margin-top: 4px; overflow: hidden; }
.qitem .bar i { display: block; height: 100%; background: var(--teal); transition: width .3s; }
.qerr { width: 160px; } .qerr small { color: var(--red); display: block; }
.pgroup { margin: 18px 0; }
.pgroup h3 { margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }
.pgroup .dn { font-family: var(--head); font-size: 13px; color: var(--orange); text-transform: uppercase; letter-spacing: .05em; }
.pplace { margin-bottom: 10px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin-top: 4px; }
.pthumb { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--paper2); }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb .ph { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 24px; }
.pthumb .fav { position: absolute; top: 4px; right: 6px; color: #FDE68A; font-size: 18px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.viewer { position: fixed; inset: 0; z-index: 80; background: #0b0d10; color: #EEF0F3; display: flex; flex-direction: column; }
.viewer .iconbtn { color: #EEF0F3; } .viewer .iconbtn:hover { background: rgba(255, 255, 255, .1); } .viewer .iconbtn.on { color: #FDE68A; background: none; }
.vbar { display: flex; align-items: center; gap: 6px; padding: 6px; }
.vimg { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; }
.vimg img { max-width: 100%; max-height: 100%; object-fit: contain; }
.vnav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; border-radius: 12px; background: rgba(0, 0, 0, .35); color: #fff; font-size: 34px; }
.vnav.prev { left: 6px; } .vnav.next { right: 6px; }
.vinfo { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: #14181F; font-size: 14px; }
.vinfo .muted { color: #9aa3ad; }
.vinfo input { background: #1E2530; color: #EEF0F3; border-color: #2C3542; }
.vinfo .av { width: 22px; height: 22px; font-size: 10px; border: 0; margin: 0 4px 0 0; vertical-align: middle; }

/* ---------------------------------------------------------------- stage 4: money */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--paper2); border-radius: 12px; padding: 4px; margin: 4px 0 8px; }
.seg button { border: 0; background: none; min-height: 38px; border-radius: 9px; font-weight: 600; color: var(--ink2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.mcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.mcard b { display: block; font-family: var(--head); font-size: 22px; font-weight: 600; color: var(--teal2); overflow-wrap: anywhere; }
.mcard span { color: var(--ink2); font-size: 13px; }
.mcard.over b { color: var(--red); }
.mbar { height: 6px; background: var(--paper2); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.mbar i { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
.mcard.over .mbar i { background: var(--red); }
.mshort { margin: 0 0 14px; } .mshort .chips { margin-top: 6px; }
.mgrid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin-bottom: 16px; }
@media (min-width: 900px) { .mgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mgrid h3 { margin: 0 0 10px; }
.mlegend { font-size: 12px; color: var(--ink2); margin: -4px 0 8px; display: flex; align-items: center; gap: 4px; }
.mlegend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.mlegend i.p, .mb i.p { background: var(--teal); } .mlegend i.s, .mb i.s { background: var(--orange); }
.mperson { padding: 8px 0; border-top: 1px solid var(--line); } .mperson:first-of-type { border-top: 0; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 8px; align-items: center; margin-top: 4px; font-size: 13px; }
.mrow .n { color: var(--ink2); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mb { display: block; height: 8px; background: var(--paper2); border-radius: 4px; overflow: hidden; margin: 4px 0 2px; }
.mb i { display: block; height: 100%; border-radius: 4px; min-width: 2px; }
.mcat { display: flex; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 6px 4px; color: inherit; font: inherit; }
.mcat.on { background: var(--teal-soft); } .mcat .em { font-size: 20px; width: 26px; text-align: center; } .mcat .grow { flex: 1; min-width: 0; }
.mday { justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; } .mday:last-child { border-bottom: 0; }
.mfilter { gap: 8px; margin: 6px 0 10px; } .mfilter select { flex: 1; min-width: 0; }
.mdate { font-weight: 600; color: var(--ink2); font-size: 13px; margin: 14px 0 6px; }
.mexp { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.mexp .em { font-size: 22px; width: 30px; text-align: center; flex: none; }
.mexp .t, .mexp .s { display: block; overflow-wrap: anywhere; }
.mexp .n { text-align: right; white-space: nowrap; } .mexp .n .s { display: block; font-size: 12px; color: var(--mute); }
.mcats { margin: 2px 0 14px; max-height: 132px; overflow-y: auto; } .mcats .chip { min-height: 34px; padding: 0 11px; font-size: 13px; }
.msplit { border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; margin-bottom: 6px; }
.msrow { gap: 8px; border-bottom: 1px solid var(--line); } .msrow:last-child { border-bottom: 0; }
.msrow .check { min-width: 0; } .msrow .check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msval { width: 84px; flex: none; min-height: 38px; padding: 6px 8px; text-align: right; }
.msrow .n { width: 92px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; flex: none; }
.mconv { min-height: 48px; display: flex; align-items: center; font-weight: 600; font-size: 17px; }

/* ---------------------------------------------------------------- stage 5: trip book */
.bookhero { display: flex; gap: 16px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 12px; }
.bookhero svg.big { width: 56px; height: 56px; flex: none; color: var(--teal); }
.bookhero h2 { margin: 0 0 4px; } .bookhero p { margin: 0; } .bookhero .grow { flex: 1; min-width: 0; }
.bookhero .err { margin-top: 10px; }
.bookbtns { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; } .bookbtns .btn { flex: 1; min-width: 110px; }
.spin.sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: -3px; margin-right: 6px; }
.bookt .item .t, .bookt .item .s, .money .item .t, .money .item .s { display: block; }
.btn.text.danger-text { color: var(--red); }
