:root {
  --paper: #f2eadb;
  --paper-2: #ebe1cf;
  --card: #f9f4ea;
  --ink: #1c1a17;
  --ink-2: #5d564b;
  --ink-3: #91887a;
  --line: #d3c7b1;
  --red: #cf3a24;
  --red-deep: #a82a18;
  --indigo: #24395c;
  --moss: #5f7148;
  --gold: #b88a2e;
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --rail: 232px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 15.5px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .4 0 0 0 0 .3 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body[data-state="loading"] .rail, body[data-state="loading"] main, body[data-state="gate"] .rail, body[data-state="gate"] main, body[data-state="app"] #gate { display: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; line-height: 1.15; }
p { margin: 0 0 10px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--indigo); }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

/* ───── Rail ───── */
.rail { position: fixed; inset: 0 auto 0 0; width: var(--rail); background: var(--ink); color: var(--paper); display: flex; flex-direction: column; padding: 28px 22px 22px; z-index: 10; overflow-y: auto; }
.brand { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 30px; }
.brand-jp { writing-mode: vertical-rl; font-family: var(--serif); font-weight: 800; font-size: 30px; letter-spacing: .14em; line-height: 1; padding: 10px 7px; background: var(--red); color: #fff5ea; }
.brand-en { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; line-height: 1.7; color: #b9ae9b; padding-top: 4px; }
#nav { display: flex; flex-direction: column; gap: 1px; }
#nav button { display: flex; align-items: baseline; gap: 6px; background: none; border: 0; color: #cfc5b3; text-align: left; padding: 8px 10px 8px 14px; border-left: 2px solid transparent; font-weight: 500; transition: color .15s, border-color .15s, padding .15s; }
#nav button span { margin-left: auto; font-family: var(--serif); font-size: 12.5px; color: #7c7364; }
#nav button:hover { color: #fff; padding-left: 18px; }
#nav button.on { color: #fff; border-left-color: var(--red); background: rgba(255,255,255,.05); }
#nav button.on span { color: var(--red); }
.pip { width: 7px; height: 7px; border-radius: 50%; background: var(--red); display: inline-block; }
.rail-foot { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; font-size: 13px; color: #b9ae9b; }
.link { background: none; border: 0; padding: 0; font-size: 13px; color: var(--indigo); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--red); }
.rail .link { color: #9a917f; }
.rail .link:hover { color: #fff; }

/* ───── Main ───── */
main { margin-left: var(--rail); padding: 44px clamp(20px, 5vw, 72px) 96px; max-width: 1320px; outline: none; }
.view > * { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
.view > *:nth-child(2) { animation-delay: .06s; }
.view > *:nth-child(3) { animation-delay: .12s; }
.view > *:nth-child(4) { animation-delay: .18s; }
.view > *:nth-child(n+5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .view > *, .sun { animation: none !important; } }

.head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--ink); padding-bottom: 16px; flex-wrap: wrap; }
.head h1 { font-size: clamp(32px, 4.4vw, 52px); letter-spacing: -.01em; }
.jp { font-family: var(--serif); color: var(--red); }
.head .jp { font-size: 20px; padding-bottom: 6px; }
.head .sub { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-2); text-align: right; padding-bottom: 6px; }
.head-act { display: flex; gap: 8px; padding-bottom: 4px; flex-wrap: wrap; }
.lede { color: var(--ink-2); max-width: 70ch; margin-bottom: 20px; }
.sec { font-size: 24px; margin: 34px 0 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sec .jp { font-size: 16px; }
.sec small { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--ink-2); }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; align-self: center; }

.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); display: block; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.good { color: var(--moss); } .bad { color: var(--red-deep); }
.mt { margin-top: 20px; } .mt-s { margin-top: 12px; } .mb { margin-bottom: 18px; }
.grow { flex: 1; min-width: 0; }
.note { display: block; font-size: 13px; color: var(--ink-2); font-weight: 400; }

.card { background: var(--card); border: 1px solid var(--line); padding: 22px; position: relative; min-width: 0; }
.card h2 { font-size: 21px; margin-bottom: 14px; }
.card h3 { font-size: 18px; margin-bottom: 8px; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.callout { border-left: 3px solid var(--red); background: var(--paper-2); padding: 9px 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ext { white-space: nowrap; font-size: 13px; }
.row-act { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px dotted var(--line); font-size: 14.5px; }
ul.plain li:last-child { border: 0; }
ul.links li span { display: block; font-size: 13px; color: var(--ink-2); }
ul.links .ext { font-size: 15px; font-weight: 700; }

/* ───── forms ───── */
input[type=text], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=url], select, textarea {
  background: transparent; border: 0; border-bottom: 1px solid var(--ink-3); padding: 7px 2px; min-width: 0; width: 100%; border-radius: 0;
}
textarea { resize: vertical; border: 1px solid var(--ink-3); padding: 8px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 1px 0 var(--red); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input[type=color] { width: 100%; height: 36px; padding: 0; border: 1px solid var(--ink-3); background: none; }
.f { display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); border: 0; padding: 0; margin: 0; min-width: 0; }
.f legend { padding: 0; margin-bottom: 6px; }
.f input, .f select, .f textarea { font-family: var(--sans); font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--ink); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.fgrid.tri { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.w2 { grid-column: 1 / -1; }
.moneyrow { display: flex; gap: 8px; }
.moneyrow select { width: 92px; flex: 0 0 auto; }
.fcheck { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.btn { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); padding: 8px 16px; font-weight: 700; font-size: 13.5px; white-space: nowrap; text-decoration: none; display: inline-block; transition: background .15s, color .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.danger { color: var(--red-deep); border-color: var(--red-deep); }
.btn.danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn.sm { padding: 4px 11px; font-size: 12.5px; }
.btn.big { padding: 13px 26px; font-size: 16px; }
.x { background: none; border: 0; color: var(--ink-3); font-size: 19px; line-height: 1; padding: 4px 6px; opacity: 0; transition: opacity .15s, color .15s; }
.x:hover { color: var(--red); }
li:hover .x, .x:focus-visible, .x.on { opacity: 1; }
@media (hover: none) { .x { opacity: 1; } }
.addrow { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; }
.addrow > input { flex: 1; }

/* chips, avatars, status */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line); padding: 4px 10px; background: var(--card); }
button.chip:hover, button.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pchip { cursor: pointer; }
.pchip input { position: absolute; opacity: 0; pointer-events: none; }
.pchip span { display: inline-block; font-family: var(--sans); font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--ink); border: 1px solid var(--ink-3); padding: 4px 12px; border-radius: 99px; transition: background .12s, color .12s; }
.pchip input:checked + span { background: var(--c, var(--ink)); border-color: var(--c, var(--ink)); color: #fff; }
.pchip input:focus-visible + span { outline: 2px solid var(--indigo); outline-offset: 2px; }
.who { display: inline-flex; flex: 0 0 auto; }
.av { width: 24px; height: 24px; border-radius: 50%; background: var(--c, var(--indigo)); color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; box-shadow: 0 0 0 2px var(--card); }
.who .av + .av { margin-left: -6px; }
.av.all { background: var(--ink); font-family: var(--serif); }
.st { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border: 1px solid currentColor; white-space: nowrap; flex: 0 0 auto; }
.st.booked { color: #fff; background: var(--moss); border-color: var(--moss); }
.st.planned { color: var(--red-deep); }
.st.option { color: var(--ink-2); border-style: dashed; }
.tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border: 1px solid currentColor; color: var(--indigo); white-space: nowrap; }
.amt2 { font-family: var(--mono); font-size: 13px; text-align: right; white-space: nowrap; flex: 0 0 auto; }
.amt2 small { display: block; color: var(--ink-3); font-size: 11.5px; }

/* lists */
ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dotted var(--line); }
ul.list li:last-child { border-bottom: 0; }
.rowbtn { background: none; border: 0; padding: 0; text-align: left; }
.rowbtn:hover { color: var(--red-deep); }
.check { appearance: none; flex: 0 0 auto; width: 19px; height: 19px; border: 1.5px solid var(--ink); background: transparent; margin: 0; cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .15s; }
.check:checked { background: var(--red); border-color: var(--red); transform: rotate(-6deg); }
.check:checked::after { content: "済"; font-family: var(--serif); font-size: 12px; color: #fff; line-height: 1; }
li.done .grow { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--red); }
.empty { color: var(--ink-3); font-style: italic; padding: 8px 0; font-size: 14px; }
.alert { display: flex; gap: 10px; align-items: baseline; background: none; border: 0; padding: 0; text-align: left; margin: 0; }
button.alert:hover { color: var(--red-deep); }
.alert i { font-style: normal; font-family: var(--serif); font-weight: 800; background: var(--red); color: #fff; width: 18px; height: 18px; display: inline-grid; place-items: center; font-size: 12px; flex: 0 0 auto; transform: rotate(-6deg); }

/* ───── Hero ───── */
.hero { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); padding: clamp(26px, 4vw, 52px); min-height: 330px; display: flex; flex-direction: column; justify-content: flex-end; }
.sun { position: absolute; right: -70px; top: -90px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #df5038, var(--red) 60%, var(--red-deep)); animation: sun 1.1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes sun { from { transform: translate(60px, -60px) scale(.8); opacity: 0; } }
.hero-vert { position: absolute; right: 34px; top: 30px; writing-mode: vertical-rl; font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: .3em; color: #fff3e6; }
.hero-count { position: relative; display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.hero-count b { font-family: var(--serif); font-weight: 800; font-size: clamp(96px, 17vw, 210px); line-height: .82; letter-spacing: -.04em; }
.hero-count span { font-family: var(--serif); font-size: clamp(18px, 2.2vw, 26px); max-width: 9em; line-height: 1.25; }
.hero h1 { position: relative; font-size: clamp(24px, 3vw, 36px); margin-top: 22px; }
.hero-meta { position: relative; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.season { position: relative; margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--ink-3); max-width: 62ch; font-size: 14px; }
.season b { font-family: var(--serif); color: var(--red-deep); }
.stat { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--ink); padding: 16px 18px; text-align: left; transition: transform .15s, border-color .15s; width: 100%; }
.stat:hover { transform: translateY(-3px); border-top-color: var(--red); }
.stat b { display: block; font-family: var(--serif); font-size: 30px; line-height: 1.1; margin: 4px 0 2px; }
.stat small { color: var(--ink-2); font-size: 12.5px; }
.conv { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: end; max-width: 520px; margin-bottom: 12px; }
.conv .eq { font-family: var(--serif); font-size: 24px; color: var(--red); padding-bottom: 4px; }
.conv input { font-family: var(--mono); font-size: 22px; }

/* route ribbon */
.ribbon { display: flex; align-items: stretch; overflow-x: auto; padding-bottom: 6px; }
.stop { background: var(--paper); border: 1px solid var(--ink); padding: 12px 18px; text-align: left; flex: 0 0 auto; min-width: 128px; transition: background .15s, color .15s; }
.stop:hover { background: var(--ink); color: var(--paper); }
.stop b { display: block; font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.stop span { display: block; font-size: 13px; }
.stop small { font-family: var(--mono); font-size: 11px; opacity: .7; }
.hop { background: none; border: 0; padding: 0 4px; display: flex; align-items: center; gap: 4px; flex: 1 0 84px; font-family: var(--mono); font-size: 11.5px; }
.hop i { flex: 1; border-top: 2px solid var(--ink); min-width: 14px; }
.hop.todo i { border-top: 2px dashed var(--red); }
.hop.todo span { background: var(--red); color: #fff; width: 20px; height: 20px; display: grid; place-items: center; font-family: var(--serif); font-weight: 800; transform: rotate(-6deg); }
.hop.ok span { font-family: var(--mono); }

/* ───── Itinerary ───── */
.daystrip { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 26px; }
.daystrip a { text-decoration: none; color: var(--ink); font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line); background: var(--card); padding: 5px 9px; text-align: center; min-width: 52px; }
.daystrip a:hover { background: var(--ink); color: var(--paper); }
.daystrip a.has { border-bottom: 2px solid var(--red); }
.daystrip a b { display: block; font-family: var(--serif); font-size: 15px; }
.day { display: grid; grid-template-columns: 148px minmax(0, 1fr); margin-bottom: 18px; background: var(--card); border: 1px solid var(--line); scroll-margin-top: 20px; }
.day.today { border-color: var(--red); box-shadow: 4px 4px 0 var(--red); }
.day-side { padding: 20px 18px; border-right: 1px solid var(--line); background: var(--paper-2); }
.day-side .kanji { font-family: var(--serif); font-weight: 800; font-size: 34px; line-height: 1; color: var(--red); }
.day-side .kanji small { font-size: 15px; color: var(--ink); font-weight: 700; }
.day-side .date { font-family: var(--mono); font-size: 12px; margin-top: 10px; color: var(--ink-2); }
.day-side .date b { display: block; color: var(--ink); font-weight: 500; font-size: 13px; }
.day.weekend .day-side .date b { color: var(--red-deep); }
.day-body { padding: 16px 20px 14px; min-width: 0; }
.day-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.day-top h3 { font-size: 21px; }
.day-top h3.muted { font-size: 15px; font-family: var(--sans); font-weight: 400; font-style: italic; color: var(--ink-3); }
.items { list-style: none; margin: 8px 0 0; padding: 0; }
.items li { border-bottom: 1px dotted var(--line); }
.items li:last-child { border-bottom: 0; }
.ev { width: 100%; display: flex; gap: 12px; align-items: center; background: none; border: 0; padding: 8px 4px; text-align: left; transition: background .12s; }
.ev:hover { background: var(--paper-2); }
.ev time { font-family: var(--mono); font-size: 12.5px; color: var(--red-deep); width: 44px; flex: 0 0 auto; }
.kind { font-family: var(--serif); font-weight: 800; font-size: 13px; width: 24px; height: 24px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.k-flight { background: var(--indigo); } .k-stay { background: var(--gold); } .k-train { background: var(--red); } .k-activity { background: var(--moss); }

/* ───── Flights: boarding pass ───── */
.bp { display: grid; grid-template-columns: minmax(0, 1fr) 250px; background: var(--card); border: 1px solid var(--line); margin-bottom: 16px; transition: transform .15s, box-shadow .15s; }
.bp:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.bp-main { padding: 22px 26px; min-width: 0; }
.bp-route { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; gap: 18px; align-items: center; }
.bp-route b { display: block; font-family: var(--serif); font-weight: 800; font-size: clamp(34px, 5vw, 56px); line-height: 1; letter-spacing: .02em; }
.bp-route span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.bp-route em { font-style: normal; color: var(--red-deep); font-family: var(--mono); font-size: 11px; }
.bp-route time { font-family: var(--mono); font-size: 20px; }
.bp-route .r { text-align: right; }
.bp-line { display: flex; align-items: center; gap: 10px; }
.bp-line i { flex: 1; border-top: 2px dotted var(--ink-3); }
.bp-line span { font-family: var(--mono); font-size: 12px; margin: 0; white-space: nowrap; color: var(--ink); }
.bp-stub { border-left: 2px dashed var(--line); padding: 18px 20px; background: var(--paper-2); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; align-content: flex-start; }
.bp-stub dl { width: 100%; margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; }
.bp-stub dt, .kv dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); padding-top: 3px; }
.bp-stub dd, .kv dd { margin: 0; }
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }

/* ───── Stays ───── */
.cover { display: flex; gap: 2px; height: 26px; }
.cover i { flex: 1; min-width: 3px; }
.gap { background: repeating-linear-gradient(-45deg, transparent 0 4px, var(--red) 4px 6px); outline: 1px solid var(--red); outline-offset: -1px; }
.cover-legend { display: flex; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); margin-top: 8px; }
.cover-legend span:last-child { margin-left: auto; }
.cover-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; }
.stay { background: var(--card); border: 1px solid var(--line); padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.stay.option { border-style: dashed; border-color: var(--ink-3); background: transparent; }
.stay-h { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.stay-h h3 { font-size: 21px; margin-bottom: 4px; }
.stay-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px dotted var(--line); border-bottom: 1px dotted var(--line); padding: 10px 0; }
.stay-nums .amt2 { text-align: left; display: block; font-size: 15px; }
.stay-f { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: auto; }
.stay p { margin: 0; }

/* ───── Trains ───── */
.leg { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--ink); padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.leg.todo { border-left-color: var(--red); }
.leg-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.leg-h h3 { font-size: 23px; }
.arrow { color: var(--red); }
.leg p { margin: 0; }
.ref { background: var(--paper-2); padding: 9px 12px; }
.hint { background: var(--paper-2); padding: 9px 12px; margin: 14px 0 0; }
.hint:empty, .err:empty { display: none; }
.err { color: var(--red-deep); margin: 10px 0 0; }
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); text-align: left; font-weight: 400; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.tbl td { padding: 9px 10px 9px 0; border-bottom: 1px dotted var(--line); white-space: nowrap; }
.tbl .num { text-align: right; font-family: var(--mono); }
.tbl td .av { vertical-align: middle; margin-right: 4px; }
ol.tips { margin: 0; padding: 0; list-style: none; counter-reset: t; }
ol.tips li { counter-increment: t; padding: 9px 0 9px 38px; position: relative; border-bottom: 1px dotted var(--line); font-size: 14.5px; }
ol.tips li:last-child { border: 0; }
ol.tips li::before { content: counter(t, cjk-ideographic); position: absolute; left: 0; top: 7px; font-family: var(--serif); font-weight: 800; color: var(--red); font-size: 18px; }

/* ───── Budget ───── */
.bar { height: 10px; background: var(--paper-2); border: 1px solid var(--line); position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--indigo); transition: width .5s cubic-bezier(.2,.7,.2,1); }
.bar.over i { background: var(--red); }
.big { font-family: var(--serif); font-weight: 800; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; }
.catrow { display: grid; grid-template-columns: 124px 1fr 84px; gap: 12px; align-items: center; font-size: 13.5px; padding: 5px 0; }
.catrow .amt { font-family: var(--mono); font-size: 12.5px; text-align: right; }

/* ───── Checklist ───── */
.group { margin-bottom: 20px; }
.group-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.group-h h2 { margin: 0; }
.due { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.due.late { color: #fff; background: var(--red); padding: 1px 7px; }
.count { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }

/* ───── Places ───── */
.place { background: var(--card); border: 1px solid var(--line); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; transition: transform .15s, box-shadow .15s; min-width: 0; }
.place:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.place h3 { font-size: 19px; }
.place p { margin: 0; }
.place-foot { display: flex; gap: 10px; align-items: center; margin-top: auto; padding-top: 8px; }
.place-foot select { font-size: 12.5px; padding: 3px 2px; }
.heart { background: none; border: 1px solid var(--line); padding: 2px 10px; font-family: var(--mono); font-size: 13px; color: var(--ink-3); white-space: nowrap; transition: color .15s, border-color .15s, transform .15s; }
.heart:hover { transform: scale(1.08); }
.heart.on { color: var(--red); border-color: var(--red); }

/* ───── Phrases ───── */
.phrase { display: grid; grid-template-columns: 1fr 1.1fr; gap: 6px 18px; padding: 12px 0; border-bottom: 1px dotted var(--line); align-items: baseline; }
.phrase .en { font-weight: 500; }
.phrase .ja { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.phrase .ro { font-family: var(--mono); font-size: 12px; color: var(--red-deep); display: block; }

/* ───── Dialog ───── */
dialog.sheet { border: 1px solid var(--ink); background: var(--card); color: var(--ink); padding: 0; width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 8px 8px 0 var(--ink); }
dialog.sheet::backdrop { background: rgba(28, 26, 23, .55); }
dialog.sheet[open] { animation: rise .25s cubic-bezier(.2,.7,.2,1); }
dialog.sheet form { padding: 24px 26px; }
dialog.sheet header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; border-bottom: 1px solid var(--ink); padding-bottom: 12px; }
dialog.sheet h2 { font-size: 28px; }
dialog.sheet h2 .jp { font-size: 17px; }
dialog.sheet footer { display: flex; gap: 10px; margin-top: 22px; align-items: center; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; font-size: 13.5px; z-index: 2147483647; border-left: 4px solid var(--red); max-width: calc(100vw - 32px); }

/* ───── Gate (sign-in) ───── */
#gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); padding: clamp(28px, 6vw, 64px); width: min(720px, 100%); min-height: 420px; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; align-items: flex-start; }
.gate-card > * { position: relative; }
.gate-card .sun { position: absolute; }
.gate-card .brand-jp { position: absolute; left: clamp(28px, 6vw, 64px); top: clamp(28px, 6vw, 64px); }
.gate-card h1 { font-size: clamp(40px, 8vw, 76px); font-weight: 800; letter-spacing: -.02em; }
.gate-card p { max-width: 44ch; font-size: 17px; margin: 0; }
.gate-card .addrow { width: 100%; max-width: 460px; }

/* ───── Responsive ───── */
@media (max-width: 1040px) {
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .rail { position: sticky; top: 0; inset: auto; width: auto; flex-direction: row; align-items: center; padding: 8px 12px; gap: 10px; overflow: visible; }
  .brand { margin: 0; }
  .brand-jp { writing-mode: horizontal-tb; font-size: 15px; padding: 5px 8px; letter-spacing: .05em; white-space: nowrap; }
  .brand-en, .rail-foot { display: none; }
  #nav { flex-direction: row; overflow-x: auto; flex: 1; scrollbar-width: none; }
  #nav button { border-left: 0; border-bottom: 2px solid transparent; padding: 8px 10px; white-space: nowrap; font-size: 13.5px; }
  #nav button span { display: none; }
  #nav button:hover { padding-left: 10px; }
  #nav button.on { border-bottom-color: var(--red); }
  main { margin-left: 0; padding: 24px 16px 72px; }
  .head .sub { margin-left: 0; text-align: left; width: 100%; }
  .sun { width: 250px; height: 250px; right: -70px; top: -80px; }
  .hero-vert { font-size: 16px; right: 18px; top: 18px; }
  .day { grid-template-columns: minmax(0, 1fr); }
  .day-side { border-right: 0; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 14px; padding: 12px 16px; }
  .day-side .date { margin: 0; }
  .day-side .date b { display: inline; margin-right: 6px; }
  .bp { grid-template-columns: minmax(0, 1fr); }
  .bp-stub { border-left: 0; border-top: 2px dashed var(--line); }
  .bp-main { padding: 18px; }
  .bp-route { gap: 10px; }
  .phrase, .fgrid, .fgrid.tri { grid-template-columns: minmax(0, 1fr); }
  .catrow { grid-template-columns: 104px 1fr 76px; }
  .ev { flex-wrap: wrap; }
  .ev .grow { flex-basis: 60%; }
  dialog.sheet form { padding: 18px; }
}
