/* Fieldbook, style 1: black on white, heavy type, colour only for fills and accents. Readable in sunlight. */
:root {
  --ink: #000; --paper: #fff; --line: #d4d4d4; --soft: #f2f4f2; --muted: #1f1f1f;
  --sight: #c2410c; --meal: #15803d; --rest: #4338ca; --transport: #00843d; --logistics: #334155;
  --alert: #b91c1c; --taxi: #ffd400; --amber: #f59e0b; --ask: #c96442; --ask-ink: #8a3a1f;
  color-scheme: light;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
#app { max-width: 640px; margin: 0 auto; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1 { font-size: 1.65rem; font-weight: 800; line-height: 1.1; margin: 2px 0 0; }
h2 { font-size: 1.2rem; font-weight: 800; line-height: 1.2; margin: 2px 0 6px; }
p { margin: 6px 0; }
:focus-visible { outline: 3px solid var(--sight); outline-offset: 2px; }
.loading { padding: 40px 20px; font-weight: 800; }

/* Headers */
.top { padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 10px; }
.top.bar { border-bottom: 3px solid var(--ink); }
.top.t-meal { background: var(--meal); color: #fff; border-bottom: 0; }
.top.t-sight { border-bottom-color: var(--sight); }
.hero { background: var(--sight); color: #fff; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 16px; }
.date { font-size: .8rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sub { font-size: .9rem; font-weight: 600; margin-top: 4px; }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.body { padding: 10px 16px 28px; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; text-decoration: none; }
.lead { font-size: 1rem; }
.n { font-size: .88rem; color: var(--muted); }
.top.t-meal .n, .hero .n { color: #fff; }
.sec { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 6px; }
.empty { color: #333; }
.fine { font-size: .8rem; color: #333; }
.ribbon { background: var(--taxi); color: #000; text-align: center; font-weight: 800; font-size: .85rem; padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px; }

/* Chips and tiles */
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.chip { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 800; line-height: 1.3; }
.chip.out { border: 2px solid var(--ink); padding: 1px 8px; }
.chip.taxi { background: var(--taxi); color: #000; }
.chip.diet { background: var(--meal); color: #fff; }
.tile { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; font-weight: 800; font-size: .9rem; color: #fff; background: var(--logistics); }
.tile.t-sight, .mini.t-sight { background: var(--sight); }
.tile.t-meal, .mini.t-meal { background: var(--meal); }
.tile.t-rest, .mini.t-rest { background: var(--rest); }
.tile.t-transport, .mini.t-transport { background: var(--transport); }
.tile.t-logistics, .mini.t-logistics { background: var(--logistics); }
.tile.done { background: #9ca3af; }
.opt { font-size: .7rem; font-weight: 800; border: 1.5px dashed #444; border-radius: 6px; padding: 0 5px; vertical-align: 2px; }

/* Buttons */
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btns .btn { flex: 1 1 auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); color: var(--ink); font-weight: 800; text-decoration: none; text-align: center; }
.btn.p { background: var(--ink); color: var(--paper); }
.btn.big { width: 100%; min-height: 54px; font-size: 1.05rem; margin-top: 10px; }
.btn.small { min-height: 38px; padding: 4px 12px; }
.btn[disabled], .go[disabled] { opacity: .5; }
.guide-link { width: 100%; margin-top: 10px; justify-content: flex-start; }
.pill { min-height: 40px; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); font-weight: 800; font-size: .85rem; }
.pill.on { background: var(--ink); color: var(--paper); }
.link { text-decoration: underline; font-weight: 800; }

/* Alerts and notes */
.alert { background: var(--alert); color: #fff; border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.alert summary { cursor: pointer; }
.alert .src, .alert a { color: #fff; border-top-color: rgba(255, 255, 255, .4); }
.pace, .pace-once { border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-size: .9rem; }
.pace-once .pace { border: 0; padding: 0; margin: 0 0 6px; }
.pace ul { margin: 4px 0; padding-left: 18px; }

/* Next card */
.next { border: 3px solid var(--transport); border-radius: 14px; padding: 12px; margin: 10px 0; }
.lbl { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--transport); }
.now { background: var(--soft); border-radius: 10px; padding: 8px 10px; margin-top: 8px; font-size: .9rem; }
.now .r { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.now .r.late b { color: var(--alert); }

/* Stop list */
.stops { list-style: none; margin: 0; padding: 0; }
.stop { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.stop .tick { min-width: 44px; min-height: 56px; display: flex; align-items: center; }
.stop-main { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: flex-start; padding: 10px 0; text-decoration: none; }
.tm { width: 50px; flex: none; font-weight: 800; }
.tm.label { font-size: .78rem; line-height: 1.2; padding-top: 2px; }
.x { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.h { font-weight: 800; }
.map { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink); border-radius: 12px; text-decoration: none; }
.stop.past .stop-main, .stop.done .stop-main { opacity: .55; }
.stop.done .h { text-decoration: line-through; }
.stop.is-next .tm { color: var(--transport); }
.daynav { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }

/* Detail panels */
.panel { margin: 12px 0; }
.tabs { display: flex; gap: 6px; margin: 8px 0; }
.tab { flex: 1; min-height: 44px; border: 2px solid var(--ink); border-radius: 10px; font-weight: 800; font-size: .9rem; }
.tab.on { background: var(--ink); color: var(--paper); }
.legs { list-style: none; margin: 4px 0; padding: 0; }
.leg { display: flex; gap: 10px; padding: 7px 0; font-size: .95rem; align-items: flex-start; }
.leg .dot { width: 40px; flex: none; text-align: center; }
.kv { display: flex; gap: 10px; padding: 4px 0; font-size: .92rem; }
.kv .k { width: 78px; flex: none; font-weight: 800; }
.kv .v { flex: 1; min-width: 0; }
.src { font-size: .78rem; color: #333; margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.scroll-x { overflow-x: auto; }
.board { width: 100%; border-collapse: collapse; font-size: .95rem; }
.board th { font-size: .75rem; text-align: left; padding: 4px; }
.board td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.board td.t { font-weight: 800; font-variant-numeric: tabular-nums; }
.board tr.plan td { background: #e7f6ec; }
.board tr.gone td.t { color: #6b6b6b; text-decoration: line-through; }
.board .rnote td { font-size: .8rem; color: var(--muted); padding-top: 0; }
.tag { font-size: .68rem; font-weight: 800; background: var(--transport); color: #fff; border-radius: 5px; padding: 1px 5px; }
.tag.flag { background: var(--ink); }
.say { border: 3px dashed var(--meal); border-radius: 12px; padding: 10px; margin: 10px 0; }
.say .big { font-size: 1.35rem; font-weight: 800; }
details.more, details.kid { border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; margin: 8px 0; }
details > summary { cursor: pointer; min-height: 28px; }
details.kid { background: #eef2ff; border-color: var(--rest); }
.ans { color: var(--rest); font-weight: 800; }
.extra { padding: 6px 0; border-bottom: 1px solid var(--line); }
.opt-card { border-left: 5px solid var(--line); padding: 4px 10px; margin: 8px 0; }
.opt-card.rec { border-left-color: var(--transport); }
.plain, .dots { padding-left: 18px; }
.dots li { margin: 6px 0; }
.stay .sub { margin-top: 12px; }
.steps { padding-left: 22px; margin: 4px 0; }
.steps li { margin: 4px 0; }
.links { list-style: none; padding: 0; display: grid; gap: 8px; }
.links .btn { width: 100%; }

/* Days */
.days { list-style: none; margin: 0; padding: 0; }
.day { display: flex; gap: 12px; align-items: center; min-height: 60px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.day.past { opacity: .5; }
.day.today { background: #fff4e6; border-left: 6px solid var(--sight); margin: 0 -16px; padding: 10px 16px 10px 10px; }
.dd { width: 46px; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.dd .w { font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.dd .d { font-size: 1.4rem; font-weight: 800; }
.city { font-size: .78rem; font-weight: 800; color: #444; }
.warn { font-size: .78rem; font-weight: 800; color: var(--alert); }
.mini { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-left: 3px; vertical-align: -2px; }

/* Bookings */
.filters { display: flex; gap: 6px; margin-bottom: 6px; }
.bookings { list-style: none; margin: 0; padding: 0; }
.bk { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.box { width: 40px; height: 40px; flex: none; border: 3px solid var(--ink); border-radius: 9px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.box.on { background: var(--meal); border-color: var(--meal); color: #fff; }
.box.dashed { border-style: dashed; }
.bk details { flex: 1; min-width: 0; }
.bk summary { list-style: none; display: flex; flex-direction: column; gap: 3px; min-height: 40px; }
.bk summary::-webkit-details-marker { display: none; }
.bk.done .h { text-decoration: line-through; opacity: .6; }
.meta { font-size: .85rem; }
.st { font-size: .68rem; font-weight: 800; border-radius: 5px; padding: 1px 6px; margin-right: 4px; }
.st-todo { background: var(--alert); color: #fff; }
.st-unconfirmed, .st-unknown { background: var(--amber); color: #000; }
.st-booked, .st-ticked { background: var(--meal); color: #fff; }
.st-optional { border: 1.5px dashed #000; }
.st-on-the-day { background: #e2e8f0; color: #000; }

/* Guide and info */
.glist { list-style: none; padding: 0; margin: 0; }
.glist a { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; border-bottom: 1px solid var(--line); text-decoration: none; }
.glist a::after { content: "›"; font-weight: 800; }
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.icard { display: flex; flex-direction: column; gap: 4px; min-height: 92px; padding: 10px; border: 3px solid var(--ink); border-radius: 14px; background: var(--paper); color: var(--ink); text-decoration: none; }
.icard .s { font-size: .8rem; color: #1a1a1a; }

/* Ask Claude and overlays */
.ask { flex: none; min-height: 40px; padding: 8px 12px; border-radius: 999px; background: var(--ask); color: #fff; font-weight: 800; font-size: .85rem; white-space: nowrap; }
.askline { display: block; width: 100%; min-height: 44px; margin-top: 14px; border: 2px solid var(--ask); border-radius: 12px; color: var(--ask-ink); font-weight: 800; }
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; }
.dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.sheet { position: relative; width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; margin: 0 auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--paper); border-top: 5px solid var(--ask); border-radius: 20px 20px 0 0; }
.ctx { background: #fbf1ec; color: #3b1d10; border-radius: 10px; padding: 8px 10px; font-size: .85rem; }
.pre { white-space: pre-line; margin-top: 4px; }
.sheet textarea, .copybox { width: 100%; margin-top: 10px; padding: 10px; border: 2px solid var(--ink); border-radius: 10px; font-size: 1rem; }
.copybox { min-height: 120px; font-size: .85rem; }
.go { display: block; width: 100%; min-height: 52px; margin-top: 10px; border-radius: 12px; background: var(--ask); color: #fff; font-weight: 800; font-size: 1.05rem; }
.driver { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: center; padding: 24px; background: var(--paper); }
.driver .big { font-size: 2.2rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }

/* Landing and unlock */
.landing, .unlock { max-width: 520px; margin: 0 auto; padding: calc(40px + env(safe-area-inset-top, 0px)) 20px 20px; }
.landing h1, .unlock h1 { font-size: 2.2rem; }
.landing .lead { font-size: 1.1rem; }
.open, .unlock form { display: grid; gap: 8px; margin-top: 24px; }
.open input, .unlock input { width: 100%; min-height: 52px; padding: 10px 12px; border: 3px solid var(--ink); border-radius: 12px; font-size: 1.05rem; }
.open label, .unlock label { font-weight: 800; }
.err { color: var(--alert); font-weight: 800; }

/* Bottom navigation and toast */
#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around; padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px)); background: var(--paper); border-top: 3px solid var(--ink); }
#nav a { flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .75rem; font-weight: 700; text-decoration: none; }
#nav a b { font-size: 1.15rem; line-height: 1; }
#nav a.on { color: var(--sight); font-weight: 800; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 40; max-width: 600px; margin: 0 auto; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: var(--paper); font-weight: 700; }
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: rise .18s ease-out; }
  @keyframes rise { from { transform: translateY(30px); opacity: 0; } }
}

.badge { display: inline-block; font-size: .68rem; font-weight: 800; border-radius: 6px; padding: 2px 6px; vertical-align: 2px; white-space: nowrap; }
.b-required { background: var(--alert); color: #fff; }
.b-recommended { background: var(--amber); color: #000; }
.b-at-door { background: var(--meal); color: #fff; }
.b-free { border: 2px solid var(--ink); padding: 0 5px; }
.b-booked { background: var(--transport); color: #fff; }
.entry { border: 3px solid var(--ink); border-radius: 14px; padding: 10px 12px; margin: 12px 0; }
.entry .row { align-items: center; }
.entry .sec { margin: 0; }
.bk .btn.small { flex: none; align-self: center; }
.hero.has-photo { padding-top: 0; }
.hero-img { display: block; width: calc(100% + 32px); margin: 0 -16px 10px; aspect-ratio: 16 / 10; object-fit: cover; background: #00000022; }
.credit { display: block; font-size: .72rem; color: #444; padding: 3px 16px 0; text-decoration: none; }
.listen { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; margin: 10px 0; padding: 8px 14px; border-radius: 12px; background: var(--rest); color: #fff; font-weight: 800; font-size: 1rem; }
.listen span { margin-left: auto; font-size: .78rem; font-weight: 600; }
.look { list-style: none; padding: 0; }
.look li { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.look img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; background: #00000014; }
.readmore { list-style: none; padding: 0; margin: 0; }
.readmore a { display: flex; justify-content: space-between; min-height: 48px; align-items: center; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 700; }

.strip { margin: 10px 0; }
.strip-head { font-size: .85rem; margin-bottom: 4px; }
.strip-stops { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.strip-stops::before { content: ""; position: absolute; left: 9px; top: 10px; bottom: 10px; width: 5px; border-radius: 3px; background: var(--c, var(--ink)); }
.strip-stops li { position: relative; min-height: 30px; display: flex; align-items: center; gap: 6px; font-size: .92rem; }
.strip-stops li::before { content: ""; position: absolute; left: -22px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 3px solid var(--c, var(--ink)); }
.strip-stops li.board, .strip-stops li.alight { font-weight: 800; }
.strip-stops li.board::before, .strip-stops li.alight::before { width: 13px; height: 13px; left: -24px; background: var(--c, var(--ink)); }
.strip-stops li.here { background: #fff8d6; border-radius: 6px; }
.strip-stops .tag.here { background: var(--taxi); color: #000; }
.strip-stops.calls { --c: var(--alert); }
.gps-note { font-size: .88rem; font-weight: 700; background: #fff8d6; border-radius: 8px; padding: 6px 8px; }
.pill.gps.on { background: var(--taxi); color: #000; border-color: #000; }
.wx { font-size: .9rem; font-weight: 700; margin-top: 4px; }

.wallet { list-style: none; padding: 0; margin: 0 0 8px; }
.ticket { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 60px; margin: 6px 0; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 12px; text-align: left; }
.ticket .ic { width: 36px; height: 44px; flex: none; border-radius: 6px; background: var(--alert); color: #fff; font-size: .7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tv { position: fixed; inset: 0; z-index: 50; background: #fff; display: flex; flex-direction: column; }
.tv-bar { display: flex; gap: 8px; align-items: center; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; border-bottom: 3px solid var(--ink); }
.tv-title { flex: 1; }
.tv-pages { flex: 1; overflow: auto; padding: 8px; background: #f2f2f2; }
.tv-pages canvas, .tv-pages img { display: block; width: 100%; height: auto; margin: 0 auto 8px; background: #fff; }
.tv-msg, .tv-warn { padding: 12px; font-weight: 700; }
.tv-warn { background: #fff8d6; margin: 0; }
.ticket b { margin-left: auto; white-space: nowrap; }
