/* Holiday Compare – mobile-first styles (same conventions as Family Calendar). Light/dark follow the phone. */
[hidden] { display: none !important; }
:root {
  --bg: #f5f6f8; --card: #ffffff; --text: #111827; --muted: #4b5563; --line: #e5e7eb;
  --accent: #0f766e; --accent-text: #ffffff; --soft: #e6f6f4; --danger: #dc2626; --warn-bg: #fff7ed; --warn: #9a3412;
  --ad: #6d28d9; --star: #d97706; --good: #15803d;
  --tab-h: 62px; --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px); --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17; --card: #151b26; --text: #e5e7eb; --muted: #9ca3af; --line: #273043;
    --accent: #2dd4bf; --accent-text: #04201d; --soft: #13302d; --danger: #f87171; --warn-bg: #2a1a0e; --warn: #fdba74;
    --ad: #c4b5fd; --good: #4ade80; --star: #fbbf24;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 70px; scroll-padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 16px); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-left: var(--safe-left); padding-right: var(--safe-right); min-height: 100vh; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a { color: var(--accent); }

.topbar { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); padding: calc(var(--safe-top) + 6px) 12px 6px; }
.bar { display: flex; align-items: center; min-height: 44px; }
.bar h1 { flex: 1; margin: 0; font-size: 20px; text-align: center; }

.view { padding: 10px 10px calc(var(--tab-h) + var(--safe-bottom) + 24px); max-width: 640px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left); height: calc(var(--tab-h) + var(--safe-bottom));
}
.tabbar button { position: relative; border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; min-height: 48px; padding: 0; }
.tabbar button svg { padding: 2px 10px; width: 44px; height: 28px; border-radius: 14px; box-sizing: border-box; }
.tabbar button.on { color: var(--accent); font-weight: 800; }
.tabbar button.on svg { background: var(--soft); }
.badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-text); font-size: 11px; line-height: 18px; font-weight: 800; }
.dot { position: absolute; top: 5px; left: calc(50% + 10px); width: 10px; height: 10px; border-radius: 5px; background: var(--danger); border: 2px solid var(--card); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.card h2 { font-size: 17px; margin: 0 0 8px; }
.card h3 { font-size: 15px; margin: 12px 0 6px; }
.card p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.note { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }
.info { background: var(--soft); border-radius: 10px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }
.view > .info, .view > .note { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.view > .info > div, .view > .note > div { flex: 1 1 200px; }
.backup-due { border: 1px solid currentColor; }
.card.due { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn) inset; }
.card ol, .card ul { margin: 6px 0; padding-left: 20px; }
.card li { margin: 3px 0; }
.bad { color: var(--danger); }
details.card > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; flex-direction: column; justify-content: center; position: relative; padding-right: 28px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '›'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%) rotate(90deg); font-size: 24px; color: var(--muted); transition: transform .15s; }
details.card[open] > summary::after { transform: translateY(-50%) rotate(-90deg); }
details.card > summary h2 { margin: 0; }
details.card[open] > summary { margin-bottom: 8px; }
.toolbar { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.toolbar .sort { flex: 1 1 160px; margin-bottom: 0; }
.toolbar .chip { min-height: 46px; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 700; color: var(--muted); }
input[type=text], input[type=url], input[type=date], input[type=month], input[type=number], input[type=email], input[type=password], select, textarea {
  width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 8px 10px; font-size: 16px;
}
input[type=date], input[type=month] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left; }
textarea { min-height: 80px; resize: vertical; }
input::-webkit-date-and-time-value { text-align: left; }
input, select, textarea { scroll-margin-bottom: calc(var(--tab-h) + var(--safe-bottom) + 16px); }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; }

.btn { min-height: 46px; padding: 0 16px; border-radius: 23px; border: 1px solid var(--line); background: var(--card); font-weight: 650; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn.icon { min-width: 44px; padding: 0; }
.btn.block { width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 44px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }

/* Search hub */
.co.opened { opacity: .8; }
.co.opened .go { background: var(--soft); color: var(--accent); }
.co { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.co:first-of-type { border-top: 0; }
.co-main { flex: 1; min-width: 0; }
.co-name { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.co-note { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; background: var(--soft); color: var(--accent); white-space: nowrap; }
.tag.untested { background: var(--warn-bg); color: var(--warn); }
.tag.landing { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.ad { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 6px; border: 1.5px solid var(--ad); color: var(--ad); letter-spacing: 0.03em; }
.go { flex: none; min-width: 72px; }

/* Compare */
.deal { position: relative; }
.deal-head { display: flex; align-items: flex-start; gap: 8px; }
.deal-head h2 { flex: 1; margin: 0; font-size: 17px; }
.star { border: 0; background: transparent; font-size: 26px; min-width: 44px; min-height: 44px; color: var(--muted); line-height: 1; }
.star.on { color: var(--star); }
.total { font-size: 26px; font-weight: 800; }
.pp { color: var(--muted); font-weight: 600; }
.score { display: inline-block; font-weight: 800; padding: 3px 9px; border-radius: 12px; background: var(--soft); color: var(--accent); }
.best { color: var(--good); font-weight: 700; font-size: 13px; }
.deal .chips { margin-top: 4px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.cmp { border-collapse: collapse; font-size: 14px; min-width: 100%; }
table.cmp th, table.cmp td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: right; white-space: nowrap; }
table.cmp th { white-space: normal; min-width: 110px; max-width: 160px; vertical-align: bottom; }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
table.cmp tr.sum td { font-weight: 800; }
.weights .w { display: grid; grid-template-columns: 124px 1fr 24px; align-items: center; gap: 8px; min-height: 44px; }
.weights input[type=range] { width: 100%; height: 32px; accent-color: var(--accent); }

/* Flights */
.fl { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.fl:first-child { border-top: 0; }
.fl-price { font-weight: 800; font-size: 18px; min-width: 72px; }
.cached { font-size: 11.5px; color: var(--warn); font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-bottom) + 14px); transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--card); padding: 10px 16px; border-radius: 20px; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }

/* v4: favourites + account */
:root { --heart: #e11d48; }
@media (prefers-color-scheme: dark) { :root { --heart: #fb7185; } }
.bar { gap: 4px; }
.topbtn { border: 0; background: transparent; color: var(--muted); min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 22px; padding: 0; }
.bar::before { content: ''; width: 44px; flex: none; }
.bar:has(#syncChip:not([hidden]))::before { display: none; }
.topbtn.fav.on svg { fill: var(--heart); stroke: var(--heart); }
.topbtn.fav.on { background: var(--soft); }
.topbtn.sync.synced, .topbtn.sync.idle { color: var(--accent); }
.topbtn.sync.syncing { color: var(--accent); opacity: .6; }
.topbtn.sync.error, .topbtn.sync.bad { color: var(--danger); }
.topbtn.sync.offline { color: var(--muted); }
.heart { border: 0; background: transparent; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); padding: 0; flex: none; }
.heart svg { width: 24px; height: 24px; }
.heart.on { color: var(--heart); }
.heart.on svg { fill: var(--heart); stroke: var(--heart); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 8px 0 12px; }
.seg button { border: 0; background: transparent; min-height: 44px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-text); }
.check.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 10px; }
.check.consent input { margin-top: 3px; width: 20px; height: 20px; flex: none; }
.sync-line { font-weight: 600; }
.privacy h3 { margin: 14px 0 4px; }
