/* Layout: phone-first app with image-led sections — full-bleed hero, image day tiles, timeline with thumbnails,
   bottom tab bar (left rail ≥ 960px). Washi paper + ink palette with vermilion / indigo / ginkgo accents. */
/* Single light theme by design: washi paper, sumi ink, vermilion seal-red, a little indigo and ginkgo gold.
   It stays light even when the phone is in dark mode. */
:root {
  --bg: #f7f3ea;          /* washi paper */
  --surface: #fffdf8;     /* kinari cream */
  --surface-2: #f0eadc;
  --fg: #2a2724;          /* sumi ink */
  --muted: #7a746b;
  --line: #e5ddcc;
  --accent: #b8432c;      /* shu vermilion */
  --accent-soft: #f6e3dc;
  --indigo: #3b5a8c;      /* soft ai indigo for links only */
  --indigo-soft: #e4ebf4;
  --gold: #b9901f;        /* ginkgo */
  --gold-soft: #f6ecce;
  --good: #4e7a3a; --good-soft: #e3eedb;   /* matcha */
  --warn: #a8701a; --warn-soft: #f6ebd3;
  --bad: #b3261e;  --bad-soft: #f6dcda;
  --d1: #3b5a8c; --d2: #b8432c; --d3: #2e7f85; --d4: #4e7a3a; --d5: #b9901f;
  --shadow: 0 1px 2px rgba(60,50,30,.05), 0 12px 32px -14px rgba(60,50,30,.18);
  --shadow-lg: 0 2px 4px rgba(60,50,30,.06), 0 24px 48px -20px rgba(60,50,30,.28);
  --display: "Shippori Mincho B1", "Noto Serif TC", "Noto Serif JP", Georgia, serif;
  --body: "Noto Sans TC", "Noto Sans JP", "Hiragino Sans", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "DM Mono", "SF Mono", Menlo, Consolas, monospace;
  --radius: 18px;
  --tab-h: 66px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--fg);
  background: var(--bg) repeating-linear-gradient(0deg, rgba(120,95,60,.025) 0 1px, transparent 1px 3px); /* faint paper grain */
  font-family: var(--body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.22; margin: 0; text-wrap: balance; letter-spacing: .01em; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; } h4 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--indigo); }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- shell ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -2px 0 var(--accent-soft);
}
.top-in {
  display: flex; align-items: center; gap: 12px; height: 56px;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  max-width: 1180px; margin: 0 auto;
}
.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
.brand .jp { font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: var(--accent); letter-spacing: .05em; white-space: nowrap; }
.brand .en { font-family: var(--display); font-size: .92rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock { font-family: var(--mono); font-size: .76rem; color: var(--muted); white-space: nowrap; text-align: right; line-height: 1.2; }
.clock b { display: block; color: var(--fg); font-weight: 500; font-size: .95rem; }
.sync { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.sync.on { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.sync.busy { background: var(--gold); animation: pulse 1s infinite; }
.langbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: .8rem; cursor: pointer; font-weight: 600; white-space: nowrap; }
.langbtn:hover { border-color: var(--accent); }

.view {
  flex: 1; width: 100%; max-width: 1180px; margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  padding-block: 18px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom, 0px));
  animation: fadeup .32s ease both;
}
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .5; } }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(0px, env(safe-area-inset-left, 0px)); padding-right: max(0px, env(safe-area-inset-right, 0px));
}
.tabbar-in { display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tab-h); max-width: 640px; margin: 0 auto; }
.tab { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .02em; transition: color .2s; }
.tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.tab.on { color: var(--accent); }
.tab.on svg { stroke-width: 2.2; transform: translateY(-2px); }

@media (min-width: 960px) {
  :root { --tab-h: 0px; }
  .app { flex-direction: row; }
  .layout { display: grid; grid-template-columns: 210px 1fr; max-width: 1180px; margin: 0 auto; width: 100%; }
  .tabbar { position: sticky; top: calc(56px + env(safe-area-inset-top, 0px)); left: auto; right: auto; bottom: auto; border: 0; background: none; backdrop-filter: none; align-self: start; height: auto;
    padding: 22px 0 0 max(18px, env(safe-area-inset-left, 0px)); }
  .tabbar-in { display: flex; flex-direction: column; gap: 4px; height: auto; max-width: none; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: .95rem; }
  .tab.on { background: var(--accent-soft); }
  .tab.on svg { transform: none; }
  .view { padding-block: 22px 56px; }
}

/* ---------- primitives ---------- */
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 720px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card.lift { box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.eyebrow { font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.tiny { font-size: .76rem; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: .74rem; font-weight: 600; background: var(--surface-2); color: var(--fg); white-space: nowrap; }
.chip.acc { background: var(--accent-soft); color: var(--accent); }
.chip.ind { background: var(--indigo-soft); color: var(--indigo); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.glass { background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.3); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 15px; font-size: .9rem; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--fg); line-height: 1.2; transition: transform .12s, border-color .2s, background .2s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.indigo { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 11px; font-size: .8rem; border-radius: 9px; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.block { width: 100%; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.sep { height: 1px; background: var(--line); margin: 12px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: .9rem; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; min-width: 0; }
html, body, .app, .sheet, input, select, textarea, button { color-scheme: light; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 2px 0 0; flex: none; border: 2px solid #cfc5b0; border-radius: 7px; background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .15s, border-color .15s; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check.done .ct { text-decoration: line-through; color: var(--muted); }
.ct { flex: 1; min-width: 0; }
.ct .sub { display: block; font-size: .78rem; color: var(--muted); }
.pill-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pill-row::-webkit-scrollbar { display: none; }
.pill { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: .86rem; font-weight: 600; cursor: pointer; color: var(--muted); transition: all .2s; }
.pill.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.pill[data-c] { --c: var(--d1); }
.pill.on[data-c] { background: var(--c); border-color: var(--c); color: #fff; }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); background: var(--accent); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: .88rem; font-weight: 600; opacity: 0; transition: .25s; z-index: 50; pointer-events: none; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.alert { border-radius: 14px; padding: 12px 14px; font-size: .9rem; display: flex; gap: 10px; align-items: flex-start; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.good { background: var(--good-soft); color: var(--good); }
.alert.info { background: var(--indigo-soft); color: var(--indigo); }
.alert b { color: inherit; }

/* ---------- imagery ---------- */
.ph { position: relative; overflow: hidden; background: var(--surface-2); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.55) 100%); pointer-events: none; }
.ph .ov { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 18px; color: #fff; z-index: 1; }
.ph .ov h2, .ph .ov h1, .ph .ov h3 { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.ph .ov .eyebrow { color: rgba(255,255,255,.85); }

/* ---------- home ---------- */
.hero { position: relative; border-radius: 24px; overflow: hidden; min-height: 300px; display: flex; align-items: flex-end; box-shadow: var(--shadow-lg); margin-left: calc(-1 * max(18px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(18px, env(safe-area-inset-right, 0px))); border-radius: 0 0 28px 28px; }
@media (min-width: 720px) { .hero { margin: 0; border-radius: 24px; min-height: 380px; } }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 40% 60%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,24,40,.05) 20%, rgba(20,24,40,.72) 100%); }
.hero-in { position: relative; z-index: 1; color: #fff; padding: 22px max(18px, env(safe-area-inset-left, 0px)) 22px; width: 100%; }
@media (min-width: 720px) { .hero-in { padding: 28px 28px 26px; } }
.hero h1 { color: #fff; font-size: clamp(2rem, 7vw, 3rem); text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.hero h1 small { display: block; font-size: 1.05rem; font-weight: 500; opacity: .9; margin-top: 4px; letter-spacing: .08em; }
.hero .stats { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.hero .stat { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(8px); border-radius: 14px; padding: 8px 14px; }
.hero .stat b { display: block; font-family: var(--mono); font-size: 1.35rem; font-weight: 500; line-height: 1.1; }
.hero .stat span { font-size: .68rem; opacity: .85; letter-spacing: .08em; text-transform: uppercase; }
.now-card { border: 0; box-shadow: var(--shadow); padding: 0; overflow: hidden; display: grid; grid-template-columns: 1fr; }
.now-card .ph { min-height: 150px; }
.now-card .nb { padding: 18px 20px; }
@media (min-width: 720px) { .now-card { grid-template-columns: 42% 1fr; } .now-card .ph { min-height: 100%; } }
.now-card .big { font-family: var(--display); font-size: 1.35rem; margin-top: 4px; }
.countdown { display: inline-flex; align-items: baseline; gap: 6px; font-family: var(--mono); color: var(--accent); font-size: 1rem; }
.countdown b { font-size: 1.4rem; font-weight: 500; }
.next-list { display: flex; flex-direction: column; gap: 8px; }
.next-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: .92rem; }
.next-item .t { font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.wx { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; text-align: center; }
.wx div { background: var(--surface-2); border-radius: 14px; padding: 10px 4px; font-size: .78rem; }
.wx .ic { font-size: 1.5rem; line-height: 1.2; }
.wx .hi { font-family: var(--mono); font-weight: 500; }
.wx .lo { font-family: var(--mono); color: var(--muted); }
.wx .dd { font-weight: 700; }
.wx .pp { font-size: .68rem; color: var(--indigo); }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .quick { grid-template-columns: repeat(4, 1fr); } }
.qbtn { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; transition: transform .15s, box-shadow .2s; }
.qbtn:active { transform: scale(.97); }
.qbtn:hover { box-shadow: var(--shadow); }
.qbtn .emoji { font-size: 1.6rem; }
.qbtn b { font-size: .92rem; }
.qbtn span { font-size: .76rem; color: var(--muted); }
.day-scroll { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 10px; margin: 0 -2px; scrollbar-width: none; }
.day-scroll::-webkit-scrollbar { display: none; }
.daytile { --c: var(--d1); flex: 0 0 78%; scroll-snap-align: start; position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 10; cursor: pointer; border: 0; padding: 0; text-align: left; box-shadow: var(--shadow); background: var(--surface-2); }
@media (min-width: 560px) { .daytile { flex-basis: 46%; } }
@media (min-width: 960px) { .day-scroll { display: grid; grid-template-columns: repeat(5, 1fr); overflow: visible; } .daytile { flex-basis: auto; aspect-ratio: 4 / 5; } }
.daytile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.daytile:hover img { transform: scale(1.04); }
.daytile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.7) 100%); }
.daytile .ov { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; color: #fff; z-index: 1; }
.daytile .dn { display: inline-block; font-family: var(--mono); font-size: .72rem; background: var(--c); color: #fff; padding: 2px 8px; border-radius: 999px; margin-bottom: 6px; }
.daytile b { display: block; font-family: var(--display); font-size: 1.15rem; line-height: 1.2; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.daytile span { font-size: .76rem; opacity: .9; }
.daytile .done { position: absolute; top: 10px; right: 10px; z-index: 1; }

/* ---------- plan ---------- */
.daybanner { --c: var(--d1); position: relative; border-radius: 22px; overflow: hidden; min-height: 190px; display: flex; align-items: flex-end; box-shadow: var(--shadow); }
.daybanner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.daybanner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.7) 100%); }
.daybanner .ov { position: relative; z-index: 1; color: #fff; padding: 18px 20px; width: 100%; }
.daybanner .dn { font-family: var(--mono); font-size: .76rem; color: #fff; background: var(--c); display: inline-block; padding: 2px 9px; border-radius: 999px; margin-bottom: 6px; }
.daybanner h2 { color: #fff; font-size: 1.6rem; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.daybanner .sub { font-size: .88rem; opacity: .92; margin-top: 4px; }
.daybanner .wxchip { position: absolute; top: 12px; right: 12px; z-index: 1; }
.plan-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 8px 14px; font-size: .84rem; font-weight: 600; cursor: pointer; color: var(--muted); transition: all .2s; }
.seg button.on { background: var(--accent); color: #fff; }
.tl { --c: var(--d1); position: relative; display: flex; flex-direction: column; gap: 12px; padding-left: 70px; }
.tl::before { content: ""; position: absolute; left: 58px; top: 12px; bottom: 12px; width: 2px; background: var(--line); }
.ti { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; transition: transform .15s, box-shadow .2s, border-color .2s; }
.ti:hover { border-color: var(--c); box-shadow: var(--shadow); }
.ti:active { transform: scale(.985); }
.ti .time { position: absolute; left: -70px; top: 14px; width: 52px; text-align: right; font-family: var(--mono); font-size: .76rem; line-height: 1.3; color: var(--muted); }
.ti .time b { display: block; color: var(--fg); font-weight: 500; font-size: .92rem; }
.ti .dot { position: absolute; left: -17px; top: 19px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c); }
.ti.move .dot { border-color: var(--muted); width: 10px; height: 10px; left: -16px; top: 20px; }
.ti.move { background: transparent; border-style: dashed; grid-template-columns: 1fr; }
.ti.now { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent), var(--shadow); }
.ti.now .dot { background: var(--c); animation: pulse 1.6s infinite; }
.ti.done { opacity: .6; }
.ti.done .ttl b { text-decoration: line-through; }
.ti .ttl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ti .ttl b { font-size: 1rem; }
.ti .ja { font-size: .78rem; color: var(--muted); }
.ti .note { font-size: .86rem; color: var(--muted); margin-top: 4px; }
.ti .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ti .ico { font-size: 1.05rem; }
.ti.move .ttl b { font-weight: 500; font-size: .92rem; }
.ti .thumb { width: 74px; height: 74px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); }
@media (max-width: 420px) { .ti .thumb { width: 60px; height: 60px; } }
.brief { border-left: 4px solid var(--gold); }
.leaveby { font-family: var(--mono); font-size: .74rem; }

/* ---------- sheet (detail modal) ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(10,12,20,.5); z-index: 40; opacity: 0; pointer-events: none; transition: .25s; backdrop-filter: blur(2px); }
.sheet-bg.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--surface); border-radius: 24px 24px 0 0; max-height: 94vh; max-height: 94dvh; display: flex; flex-direction: column; transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-lg);
  padding-left: max(0px, env(safe-area-inset-left, 0px)); padding-right: max(0px, env(safe-area-inset-right, 0px)); }
.sheet.open { transform: translateY(0); }
.sheet-img { position: relative; height: 190px; flex: none; border-radius: 24px 24px 0 0; overflow: hidden; }
.sheet-img img { width: 100%; height: 100%; object-fit: cover; }
.sheet-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.6) 100%); }
.sheet-img .ov { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 18px; color: #fff; z-index: 1; }
.sheet-img .ov h3 { color: #fff; font-size: 1.3rem; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.sheet-img .ov .ja { font-size: .82rem; opacity: .9; }
.sheet-img .xbtn { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(0,0,0,.4); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-h h3 { font-size: 1.2rem; }
.sheet-h .ja { font-size: .82rem; color: var(--muted); font-weight: 500; }
.sheet-b { overflow-y: auto; padding: 16px 18px calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.xbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.grab { width: 44px; height: 5px; background: rgba(255,255,255,.7); border-radius: 4px; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 2; }
@media (min-width: 960px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -46%); width: min(760px, calc(100vw - 48px)); border-radius: 22px; max-height: 88vh; opacity: 0; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-img { border-radius: 22px 22px 0 0; height: 240px; }
  .grab { display: none; }
}
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fact { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.fact .k { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.fact .v { font-size: .9rem; margin-top: 3px; overflow-wrap: anywhere; }
.tiplist { display: flex; flex-direction: column; gap: 8px; padding-left: 0; margin: 0; list-style: none; }
.tiplist li { display: flex; gap: 10px; font-size: .92rem; }
.tiplist li::before { content: "◆"; color: var(--accent); font-size: .6rem; margin-top: .5em; flex: none; }
.tiplist.kids li::before { content: "★"; color: var(--gold); font-size: .8rem; margin-top: .3em; }
.addr { background: var(--indigo-soft); color: var(--fg); border-radius: 12px; padding: 12px 14px; font-size: .92rem; display: flex; gap: 10px; align-items: center; }
.addr .ja { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.driver { position: fixed; inset: 0; z-index: 60; background: #fff; color: #111; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 14px; }
.driver.open { display: flex; }
.driver .big { font-size: clamp(1.7rem, 6.5vw, 3rem); font-weight: 800; line-height: 1.3; font-family: var(--body); }
.driver .mid { font-size: clamp(1.15rem, 4.2vw, 1.7rem); line-height: 1.5; }
.driver .pre { font-size: 1rem; color: #555; }
.driver button { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; }

/* ---------- map ---------- */
.mapwrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.mapwrap > svg { display: block; width: 100%; height: auto; max-width: 100%; }
.map-note { padding: 12px 16px 0; font-size: .84rem; color: var(--muted); }
.lmap { height: 420px; width: 100%; background: var(--surface-2); position: relative; z-index: 0; }
@media (min-width: 720px) { .lmap { height: 520px; } }
.map-ctl { position: absolute; z-index: 500; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-ctl .btn { box-shadow: var(--shadow); }
.mk { --c: var(--d1); width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35); display: grid; place-items: center; }
.mk span { transform: rotate(45deg); color: #fff; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.mk.h { background: #5a524a; }
.mk.me { background: #2a7de1; border-radius: 50%; transform: none; width: 18px; height: 18px; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(42,125,225,.3); }
.leaflet-popup-content { font-family: var(--body); font-size: .9rem; margin: 10px 12px; }
.leaflet-popup-content b { display: block; font-size: 1rem; }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.map-legend { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); }
.ml { display: grid; grid-template-columns: 26px 1fr; gap: 6px 12px; align-items: center; font-size: .9rem; }
.ml .btnrow { grid-column: 2; }
@media (min-width: 560px) { .ml { grid-template-columns: 26px 1fr auto; } .ml .btnrow { grid-column: auto; } }
.ml .n { --c: var(--d1); width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-family: var(--mono); font-size: .78rem; font-weight: 500; }
.ml .n.h { background: #5a524a; color: #fff; }
.ml .dist { font-family: var(--mono); font-size: .76rem; color: var(--indigo); }

/* ---------- food ---------- */
.food { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .food { grid-template-columns: 1fr 1fr; } }
.fc { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .2s; }
.fc:hover { box-shadow: var(--shadow); }
.fc .fh { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.fc .fh b { font-size: 1.05rem; }
.fc .ja { font-size: .78rem; color: var(--muted); }
.fc .dish { font-size: .92rem; }
.fc .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.fc.open-now { border-color: var(--good); }
.star { border: 0; background: none; font-size: 1.35rem; cursor: pointer; line-height: 1; color: var(--line); flex: none; transition: transform .15s; }
.star:active { transform: scale(1.3); }
.star.on { color: var(--gold); }
.food-hero { position: relative; border-radius: 20px; overflow: hidden; min-height: 150px; display: flex; align-items: flex-end; box-shadow: var(--shadow); }
.food-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.food-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.65) 100%); }
.food-hero .ov { position: relative; z-index: 1; color: #fff; padding: 16px 18px; }
.food-hero .ov h2 { color: #fff; }

/* ---------- kids ---------- */
.score { display: flex; align-items: center; gap: 16px; }
.score .ring { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) var(--p, 0%), var(--surface-2) 0); position: relative; flex: none; transition: --p .5s; }
.score .ring::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
.score .ring b { position: relative; font-family: var(--mono); font-size: 1.25rem; font-weight: 500; }
.mission { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed var(--line); cursor: pointer; transition: opacity .2s; }
.mission:last-child { border-bottom: 0; }
.mission .mi { width: 46px; height: 46px; border-radius: 14px; background: var(--gold-soft); display: grid; place-items: center; font-size: 1.5rem; flex: none; transition: transform .2s; }
.mission:active .mi { transform: scale(.9); }
.mission.done .mi { background: var(--good-soft); }
.mission .mt { flex: 1; min-width: 0; }
.mission .mt b { display: block; }
.mission .mt span { font-size: .8rem; color: var(--muted); }
.mission .pts { font-family: var(--mono); font-size: .82rem; color: var(--gold); white-space: nowrap; }
.mission.done .pts { color: var(--good); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.badge { text-align: center; border: 1px solid var(--line); border-radius: 14px; padding: 12px 4px; background: var(--surface-2); opacity: .45; filter: grayscale(1); transition: all .3s; }
.badge.on { opacity: 1; filter: none; background: var(--gold-soft); border-color: var(--gold); transform: translateY(-2px); }
.badge .emoji { font-size: 1.8rem; }
.badge b { display: block; font-size: .74rem; margin-top: 4px; }
.bingo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bingo button { aspect-ratio: 1; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; font-size: .72rem; line-height: 1.2; padding: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; transition: all .2s; }
.bingo button .emoji { font-size: 1.5rem; }
.bingo button.on { background: var(--gold-soft); border-color: var(--gold); transform: scale(1.03); }
.phrase { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.phrase:last-child { border-bottom: 0; }
.phrase .ja { font-size: 1.08rem; font-weight: 700; }
.phrase .ro { font-size: .78rem; color: var(--muted); font-family: var(--mono); }
.phrase .mean { font-size: .86rem; }
.say { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; display: grid; place-items: center; font-size: 1.1rem; transition: transform .15s; }
.say:active { transform: scale(.9); }
.kids-hero { position: relative; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.kids-hero img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; object-position: 50% 45%; }

/* ---------- bookings ---------- */
.bk { --c: var(--d1); border-left: 5px solid var(--c); }
.bk .bh { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.bk .when { font-family: var(--mono); font-size: .8rem; color: var(--c); font-weight: 500; }
.bk .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
@media (max-width: 420px) { .bk .fields { grid-template-columns: 1fr; } }
.bk .ticket { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: .88rem; margin-top: 10px; }
.ticket .rt { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.ticket .rt b { font-family: var(--mono); font-size: 1.25rem; font-weight: 500; display: block; }
.ticket .rt span { font-size: .78rem; color: var(--muted); }
.ticket .rt .arr { color: var(--muted); font-size: .8rem; }

/* ---------- expenses ---------- */
.ex-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.ex-row:last-child { border-bottom: 0; }
.ex-row .amt { font-family: var(--mono); }
.ex-row small { display: block; color: var(--muted); font-size: .76rem; }
.conv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }

/* ---------- guide ---------- */
.acc { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.acc summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 12px; font-weight: 700; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .emoji { font-size: 1.3rem; }
.acc summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 1.3rem; }
.acc[open] summary::after { content: "–"; }
.acc .acc-b { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; font-size: .94rem; }
.acc .acc-b ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { counter-increment: s; content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--mono); font-size: .78rem; display: grid; place-items: center; flex: none; margin-top: 2px; }
.src { font-size: .72rem; color: var(--muted); }
.more-hero { position: relative; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.more-hero img { width: 100%; aspect-ratio: 16 / 6; object-fit: cover; object-position: 50% 55%; }
.more-hero .ov { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 18px; color: #fff; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.6)); }
.more-hero .ov h2 { color: #fff; }

/* confetti */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
