/* Japan Trip styles. Colours are tokens: light "washi paper" by default, dark follows the phone's setting.
   Layout: a phone column that widens and scales up on tablets and desktops (factory standard). */
:root {
  --bg: #f7f3ec; --panel: #ffffff; --panel2: #f1ebe1; --line: #e2d8c9; --text: #1d1a17; --muted: #625a50;
  --accent: #b8321f; --accent-ink: #ffffff; --accent-text: #a82c1a;
  --now-bg: #fdeae5; --warn-bg: #fff1c9; --warn-ink: #4d3700; --warn-line: #e8c65a;
  --ok: #1f7a4d; --chip: #2b2622; --chip-ink: #ffffff;
  --radius: 14px; --font: Inter, system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  --colw: 440px; --z: 1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14120f; --panel: #211d19; --panel2: #2a251f; --line: #3b342c; --text: #f5f0e8; --muted: #b9ae9f;
    --accent: #b8321f; --accent-ink: #ffffff; --accent-text: #ff8f76;
    --now-bg: #3a1f19; --warn-bg: #3a2f10; --warn-ink: #ffe7a3; --warn-line: #7a6320;
    --ok: #5fd39a; --chip: #f5f0e8; --chip-ink: #14120f;
  }
}
@media (min-width: 700px) { :root { --colw: min(760px, calc(100vw - 48px)); --z: 1.1; } }
@media (min-width: 1000px) { :root { --colw: min(1080px, calc(100vw - 140px)); --z: 1.15; } }
@media (min-width: 1500px) { :root { --colw: 1200px; --z: 1.25; } }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; }
#app { max-width: calc(var(--colw) / var(--z)); zoom: var(--z); margin: 0 auto; padding: 14px 16px 0; min-height: calc(100dvh / var(--z)); display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 14px; padding-bottom: 16px; animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.narrow { width: 100%; max-width: 640px; margin: 0 auto; }
.row { display: flex; gap: 10px; align-items: center; } .between { justify-content: space-between; } .grow { flex: 1; } .wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; gap: 14px; align-items: start; } @media (min-width: 1000px) { .grid2 { grid-template-columns: 1fr 1fr; } }
h1, h2, h3 { margin: 0; line-height: 1.2; } h1 { font-size: 22px; } h2 { font-size: 20px; } h3 { font-size: 17px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
a { color: var(--accent-text); }
button { font: inherit; color: inherit; cursor: pointer; }
.btn { min-height: 48px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--text); }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.big { min-height: 60px; font-size: 18px; width: 100%; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 44px; padding: 0 12px; font-size: 14px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.top .sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--chip-ink); font-size: 12px; font-weight: 700; white-space: nowrap; }

/* day chips */
.days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.day { min-height: 60px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; font-weight: 600; position: relative; padding: 4px 2px; }
.day .e { font-size: 20px; line-height: 1; }
.day.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.day.today::after { content: ""; position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.day.on.today::after { background: #fff; }

/* timeline */
.tl { display: flex; flex-direction: column; }
.it { display: grid; grid-template-columns: 74px 1fr auto; gap: 10px; align-items: start; padding: 11px 8px; border-top: 1px solid var(--line); border-radius: 10px; }
.it:first-child { border-top: 0; }
.it .t { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.it .t.word { font-size: 13px; }
.it .t .tz { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.it .x { font-size: 16px; line-height: 1.4; }
.it.past { opacity: .55; }
.it.now { background: var(--now-bg); border-top-color: transparent; }
.it.now + .it { border-top-color: transparent; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); margin-right: 6px; vertical-align: 2px; }
.tag.next { background: var(--chip); color: var(--chip-ink); }
.pin-btn { min-width: 44px; min-height: 44px; margin: -8px -4px -8px 0; border: 0; background: transparent; font-size: 20px; display: flex; align-items: center; justify-content: center; text-decoration: none; }

.note { background: var(--panel2); border-radius: 10px; padding: 10px 12px; font-size: 15px; line-height: 1.45; }
.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); border-radius: 10px; padding: 10px 12px; font-size: 15px; line-height: 1.45; font-weight: 600; }

/* facts: label/value pairs */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.fact { background: var(--panel2); border-radius: 10px; padding: 8px 10px; }
.fact .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.fact .v { font-size: 16px; font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }
.fact.wide { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 6px 12px; font-size: 15px; }
.kv .k { color: var(--muted); } .kv .v { font-weight: 600; overflow-wrap: anywhere; }
ul.plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.45; }

/* event card */
.ev-head { display: flex; gap: 12px; align-items: flex-start; }
.ev-head .e { font-size: 34px; line-height: 1; }
.seats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seats .btn { flex-direction: column; min-height: 72px; gap: 0; }
.seats .btn .s { font-size: 13px; font-weight: 600; opacity: .9; }
details > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; list-style: none; color: var(--accent-text); }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; margin-right: 8px; transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }

/* checklist */
.todo { display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: start; padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; cursor: pointer; }
.todo:first-child { border-top: 0; }
.todo .box { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 800; margin: 2px 0 0 4px; }
.todo.done .box { background: var(--ok); border-color: var(--ok); color: #fff; }
.todo.done .txt { text-decoration: line-through; color: var(--muted); }

.phrase { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; }
.phrase:first-child { border-top: 0; }
.phrase .jp { font-size: 20px; font-weight: 700; } .phrase .en { color: var(--muted); font-size: 14px; }

/* weather */
.wx-line { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-size: 15px; text-align: left; }
.wx-line .i { font-size: 22px; }
.wx { background: var(--panel2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.wx-top { display: flex; align-items: center; gap: 12px; }
.wx-icon { font-size: 40px; line-height: 1; }
.wx-temp { font-size: 22px; white-space: nowrap; }
.hours { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.hour { flex: 0 0 56px; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 2px; font-size: 14px; }
.hour .hi { font-size: 22px; line-height: 1.3; }
.hour.wet { border-color: #4a90d9; background: color-mix(in srgb, #4a90d9 12%, var(--panel)); }
.panel.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.read { margin: 0; font-size: 17px; line-height: 1.55; }

.hotel { border-color: var(--accent); }
.jp { font-size: 19px; font-weight: 700; line-height: 1.4; }

.shop { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 15px; min-height: 44px; }
.shop:first-of-type { border-top: 0; }
details.panel details.panel { padding: 10px 12px; }

ul.sub { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 1.4; }
.pt { display: inline-block; min-width: 0; margin-right: 8px; padding: 1px 8px; border-radius: 6px; background: var(--chip); color: var(--chip-ink); font-size: 13px; font-variant-numeric: tabular-nums; }

/* picture pack */
.pack { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pack-item { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); }
.pack-item img { width: 100%; aspect-ratio: 1080 / 1400; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* bottom tabs */
.tabs { position: sticky; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 -16px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.tabs button { min-height: 54px; border-radius: 12px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tabs button .i { font-size: 22px; line-height: 1; }
.tabs button.on { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line); }

/* full-screen overlays: QR and "show this" text. Always white with black ink so scanners and people can read it. */
.overlay { position: fixed; inset: 0; z-index: 100; background: #ffffff; color: #111111; display: flex; flex-direction: column; align-items: center; overflow-y: auto; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(20px + env(safe-area-inset-bottom, 0px)); animation: fade .2s ease-out; }
.overlay .in { width: 100%; max-width: 480px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.overlay .close { align-self: flex-end; min-height: 48px; min-width: 48px; border-radius: 12px; border: 1px solid #d0d0d0; background: #f4f4f4; color: #111; font-size: 16px; font-weight: 700; padding: 0 16px; }
.overlay .who { font-size: 28px; font-weight: 800; }
.overlay .seat { font-size: 20px; font-weight: 700; }
.overlay .meta { font-size: 16px; color: #333; font-weight: 600; }
.overlay .qr { width: min(86vw, 380px); height: auto; image-rendering: pixelated; border: 1px solid #e3e3e3; border-radius: 8px; background: #fff; }
.overlay .hint { font-size: 14px; color: #444; }
.overlay .swap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.overlay .swap button { min-height: 52px; border-radius: 12px; border: 2px solid #111; background: #fff; color: #111; font-weight: 700; font-size: 16px; }
.overlay .swap button.on { background: #111; color: #fff; }
.overlay a.live { display: flex; align-items: center; justify-content: center; min-height: 52px; width: 100%; border-radius: 12px; background: #b8321f; color: #fff; font-weight: 700; text-decoration: none; font-size: 16px; }
.overlay .say { font-size: clamp(30px, 9vw, 56px); font-weight: 800; line-height: 1.35; margin-top: 16px; overflow-wrap: anywhere; }
.overlay .say.jp { font-size: clamp(36px, 11vw, 72px); }

/* PIN pad */
.dots { display: flex; gap: 14px; justify-content: center; margin: 18px 0 8px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.dots i.on { background: var(--accent); border-color: var(--accent); }
.pin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 320px; margin: 12px auto 0; width: 100%; }
.pin button { min-height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); font-size: 24px; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--chip); color: var(--chip-ink); padding: 10px 16px; border-radius: 999px; z-index: 150; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .screen, .overlay { animation: none; } }
