/* Bookit: indigo for the brand and the picked option, amber for ratings, green for confirmed, red
   for cancellations. Bottom tab bar on phones, a side rail from 900px. No web fonts. */
:root {
  --bg: #f5f5fa; --card: #ffffff; --ink: #171a2b; --muted: #5d6178; --line: #e1e2ec; --soft: #eff0f6;
  --accent: #4338ca; --accent-ink: #ffffff; --accent-soft: #e4e3fb;
  --amber: #f59e0b; --good: #15803d; --good-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7;
  --bad: #dc2626; --bad-soft: #fee2e2; --info: #0369a1; --info-soft: #e0f2fe;
  --radius: 14px; --shadow: 0 2px 8px rgb(23 26 43 / 7%), 0 10px 30px rgb(23 26 43 / 5%);
  --bar: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1020; --card: #181a2e; --ink: #e6e7f2; --muted: #a0a3bd; --line: #2a2d47; --soft: #20223a;
    --accent: #a5b4fc; --accent-ink: #14153a; --accent-soft: #2b2d5c;
    --good: #4ade80; --good-soft: #12301f; --warn: #fbbf24; --warn-soft: #3a2c0c; --bad: #f87171; --bad-soft: #3d1717; --info: #7dd3fc; --info-soft: #0f2c3d;
    --shadow: 0 2px 10px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0 0 6px; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; margin-top: 12px; }
p { margin: 6px 0; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.grow { flex: 1; min-width: 0; } .hidden { display: none !important; } [hidden] { display: none !important; }
.boot, .loading { padding: 48px; text-align: center; color: var(--muted); }
.error { color: var(--bad); margin: 8px 0 0; }
.pad { padding: 10px 14px; } .pad-x { padding: 0 14px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.12em; background: var(--soft); padding: 1px 6px; border-radius: 6px; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Layout: bottom bar on phones */
.layout { min-height: 100vh; }
.rail { position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0; height: calc(var(--bar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: var(--card); border-top: 1px solid var(--line); }
.rail a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 11px; }
.rail a.on { color: var(--accent); font-weight: 600; }
.rail .brand { display: none; }
#view { padding: 16px 16px calc(var(--bar) + 24px); max-width: 1100px; margin: 0 auto; }
@media (min-width: 900px) {
  .layout { display: flex; }
  .rail { position: sticky; top: 0; height: 100vh; width: 92px; flex-direction: column; justify-content: flex-start; border-top: 0; border-right: 1px solid var(--line); padding: 8px 0; }
  .rail a { flex: none; padding: 12px 4px; }
  .rail .brand { display: flex; padding: 10px 4px 16px; }
  .rail .brand strong { font-size: 13px; color: var(--ink); }
  main#view { flex: 1; min-width: 0; padding: 24px 28px; }
}

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn.big { min-height: 52px; font-size: 17px; padding: 10px 20px; }
.btn.block { width: 100%; }
.link, .plain { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.plain { color: inherit; }
label { display: block; margin: 10px 0; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox] { display: inline; width: auto; margin: 0 6px 0 0; }
.small-input { width: 180px; margin: 0; padding: 6px 10px; }
.code-input { text-transform: uppercase; letter-spacing: 0.2em; font-family: ui-monospace, Consolas, monospace; font-size: 20px; text-align: center; }
.switch { display: flex; align-items: center; margin: 0; color: var(--ink); font-size: 14px; }
.grid2, .grid3 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr 1fr 1fr; } }

/* Cards and lists */
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.controls, .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions { margin: 12px 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; display: block; }
.card.flat { box-shadow: none; border: 1px solid var(--line); padding: 12px; }
.card.link { color: inherit; text-decoration: none; }
.card.link:hover { outline: 2px solid var(--accent-soft); }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 14px; }
.cards .card { margin: 0; }
.card.new { display: flex; gap: 12px; text-align: left; border: 0; font: inherit; color: inherit; cursor: pointer; }
.card.new small { display: block; margin-top: 2px; }
.row { display: flex; align-items: center; gap: 10px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows a.grow { color: inherit; text-decoration: none; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.narrow { max-width: 560px; margin: 0 auto; }
.back { display: inline-block; margin-bottom: 8px; text-decoration: none; font-size: 14px; }
.notice { background: var(--warn-soft); color: var(--warn); padding: 8px 12px; border-radius: 10px; }
.notice a { color: inherit; font-weight: 700; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--muted); text-transform: capitalize; }
.badge.good { background: var(--good-soft); color: var(--good); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); }
.big { font-size: 26px; display: block; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.feed li small { margin-left: auto; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; background: var(--soft); padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* Modals and toasts */
.modal { border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.modal.wide { width: min(720px, calc(100vw - 24px)); }
.modal::backdrop { background: rgb(0 0 0 / 45%); }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; }
.modal-body { padding: 4px 16px 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 3000; left: 50%; bottom: calc(var(--bar) + 20px); transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 12px; background: #1f2937; color: #fff; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); }


/* Rail extras */
.rail a { position: relative; }
.rail .dot-count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; }

/* Browse */
.hero { background: linear-gradient(135deg, #4338ca, #6d28d9); color: #fff; border-radius: var(--radius); padding: 22px 18px; margin-bottom: 14px; }
.hero h1 { font-size: 24px; }
.hero p { opacity: 0.9; }
.hero form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hero input, .hero select { margin: 0; flex: 1 1 200px; border: 0; }
.hero .btn { background: #fff; color: #4338ca; border-color: #fff; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.chip { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.biz-card { padding: 0; overflow: hidden; }
.biz-card .cover { height: 96px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 34px; font-weight: 800; background-size: cover; background-position: center; }
.biz-card .body { padding: 12px 14px 14px; }
.biz-card h2 { margin-bottom: 2px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.stars { color: var(--amber); letter-spacing: 1px; white-space: nowrap; }
.stars small { color: var(--muted); letter-spacing: 0; margin-left: 4px; }

/* Business page */
.biz-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.biz-head .logo { width: 64px; height: 64px; border-radius: 16px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 28px; font-weight: 800; }
.service { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.service:last-child { border-bottom: 0; }
.price { font-weight: 700; white-space: nowrap; }
.price small { font-weight: 400; color: var(--muted); }
.hours { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.hours li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.hours li.today { font-weight: 700; }
.review { padding: 10px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review .reply { margin: 6px 0 0 12px; padding: 6px 10px; border-left: 3px solid var(--accent-soft); font-size: 14px; }
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 8px; align-items: center; font-size: 12px; max-width: 280px; }
.bars .bar { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: var(--amber); }
.two-col { display: grid; gap: 14px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 340px; align-items: start; } .two-col > aside { position: sticky; top: 24px; } }

/* Booking flow */
.dates { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.date { flex: none; width: 62px; padding: 8px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; text-align: center; cursor: pointer; }
.date small { display: block; font-size: 11px; color: var(--muted); }
.date strong { display: block; font-size: 18px; }
.date.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.date.on small { color: inherit; }
.date:disabled { opacity: 0.4; cursor: default; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin: 10px 0; }
.slot { padding: 9px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.slot small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.slot.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.slot.on small { color: inherit; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 13px; }
.cal .dow { color: var(--muted); font-size: 11px; padding: 4px 0; }
.cal button { aspect-ratio: 1; border: 1px solid transparent; border-radius: 10px; background: var(--soft); color: var(--ink); font: inherit; cursor: pointer; padding: 0; }
.cal button small { display: block; font-size: 10px; color: var(--muted); }
.cal button:disabled { background: none; color: var(--muted); opacity: 0.5; cursor: default; text-decoration: line-through; }
.cal button.in { background: var(--accent-soft); }
.cal button.edge { background: var(--accent); color: var(--accent-ink); }
.cal button.edge small { color: inherit; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.runs { list-style: none; padding: 0; margin: 0; }
.runs li { margin-bottom: 6px; }
.runs button { width: 100%; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.runs button.on { border-color: var(--accent); background: var(--accent-soft); }
.runs button:disabled { opacity: 0.5; cursor: default; }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; }
.summary .total { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 700; font-size: 16px; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty input { width: 70px; text-align: center; margin: 0; }

/* Bookings */
.booking-row { display: flex; gap: 12px; align-items: center; }
.when { flex: none; width: 54px; text-align: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); padding: 6px 0; }
.when small { display: block; font-size: 11px; text-transform: uppercase; }
.when strong { display: block; font-size: 20px; line-height: 1.1; }
.ticket { text-align: center; border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
.ticket .code { font-size: 28px; display: inline-block; padding: 6px 14px; margin: 6px 0; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.timeline li { position: relative; padding: 0 0 12px 20px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline small { display: block; color: var(--muted); }
.rating-input { display: flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.rating-input input { display: none; }
.rating-input label { margin: 0; font-size: 32px; line-height: 1; color: var(--line); cursor: pointer; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: var(--amber); }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.stat small { color: var(--muted); display: block; }
.stat strong { font-size: 22px; }
.tabs.scroll { overflow-x: auto; }
.tabs.scroll button { flex: none; padding: 8px 12px; }
.day-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.day-bar input, .day-bar select { width: auto; margin: 0; }
.hours-edit .row { margin-bottom: 6px; flex-wrap: wrap; }
.hours-edit .row > strong { width: 90px; }
.hours-edit input[type=time] { width: 120px; margin: 0; }
.check-in { display: flex; gap: 8px; }
.check-in input { margin: 0; }

/* Demo checkout */
.checkout { max-width: 420px; margin: 40px auto; }
.checkout .amount { font-size: 34px; font-weight: 800; margin: 8px 0; }
.demo-tag { display: inline-block; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }

/* Packages and trips */
details.package { margin-top: 6px; font-size: 14px; }
details.package summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
details.package ol, details.package ul { margin: 6px 0; padding-left: 20px; }
.bad-text { color: var(--bad); }
.notice-card { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.notice-card ul { margin: 0; padding-left: 18px; }
.itinerary { list-style: none; margin: 0; padding: 0; }
.itinerary li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.itinerary li:last-child { border-bottom: 0; }
.itinerary .time { flex: none; width: 70px; color: var(--muted); font-size: 13px; padding-top: 1px; }
.itinerary li.idea { opacity: 0.7; }
.itinerary li.idea strong { font-style: italic; }
.stay { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); }
.trip-public { max-width: 760px; margin: 0 auto; padding: 16px; }
.trip-public header { margin-bottom: 14px; }
@media print {
  .rail, .no-print, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  main#view, #view { padding: 0 !important; max-width: none; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .stats { display: none; }
}

/* Phrasebook */
.phrase-search { margin: 0 0 10px; }
.phrases { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-bottom: 14px; }
.phrases .card { margin: 0; }
.phrase { display: flex; flex-direction: column; gap: 8px; }
.phrase .native { font-size: 24px; line-height: 1.35; margin-top: 6px; }
.phrase .say { color: var(--accent); font-style: italic; font-size: 14px; }
.phrase-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs.mini { display: inline-flex; margin: 0 0 0 8px; }
.tabs.mini button { padding: 4px 12px; }
.show-phrase { width: min(720px, calc(100vw - 16px)); }
.big-native { font-size: clamp(34px, 9vw, 64px); line-height: 1.3; font-weight: 700; margin: 12px 0; word-break: break-word; }
.show-phrase .say { font-size: 18px; color: var(--accent); font-style: italic; }
