/*
 * JAPAN FIELD BOOK — PRESENTATION LAYER
 *
 * Layout, typography, responsive behavior, and visual states live here.
 * Trip content belongs in data.js; behavior/state belongs in app.js.
 */
:root {
  --bg: #EDF0F2;
  --surface: #fff;
  --s2: #F5F7F8;
  --ink: #16213A;
  --ink2: #3B4660;
  --muted: #667287;
  --line: #D6DCE3;
  --line2: #BCC5D0;
  --gold: #F0B100;
  --goldbg: #FFF1BF;
  --goldink: #6B4A00;
  --stamp: #C8412B;
  --ok: #1F8A5B;
  --warnbg: #FFF0DD;
  --warnink: #8A4308;
  --danger: #C0392B;
  --c: #3D63D8;
  --on: #fff;
  --fd: "Bricolage Grotesque","Avenir Next","Segoe UI",system-ui,sans-serif;
  --ft: "Literata","Iowan Old Style","Palatino Linotype",Georgia,serif;
  --fr: "Zen Maru Gothic",ui-rounded,"Hiragino Maru Gothic ProN","Nunito","Segoe UI",system-ui,sans-serif;
  --fj: "Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic UI","Yu Gothic","Meiryo","Noto Sans CJK JP","Noto Sans JP",sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top,0px);
  padding-bottom: env(safe-area-inset-bottom,0px);
  color-scheme: light;
}
:root,
[data-city] {
  --ct: color-mix(in srgb,var(--c) 11%,var(--surface));
  --cs: color-mix(in srgb,var(--c) 24%,var(--surface));
  --ci: color-mix(in srgb,var(--c) 72%,var(--ink));
}
:root[data-theme=dark] {
  --bg: #0E1524;
  --surface: #172034;
  --s2: #1D2840;
  --ink: #E9EEF7;
  --ink2: #C5CEDE;
  --muted: #93A0B8;
  --line: #2B3753;
  --line2: #3D4C6C;
  --goldbg: #3A3010;
  --goldink: #FFD86B;
  --warnbg: #3A2A14;
  --warnink: #FFC58A;
  --stamp: #E5604A;
  color-scheme: dark;
}
:root[data-theme=dark],
:root[data-theme=dark] [data-city] {
  --ct: color-mix(in srgb,var(--c) 18%,var(--surface));
  --cs: color-mix(in srgb,var(--c) 30%,var(--surface));
  --ci: color-mix(in srgb,var(--c) 58%,#fff);
}
@media (prefers-color-scheme:dark) {
  :root:not([data-theme=light]) {
    --bg: #0E1524;
    --surface: #172034;
    --s2: #1D2840;
    --ink: #E9EEF7;
    --ink2: #C5CEDE;
    --muted: #93A0B8;
    --line: #2B3753;
    --line2: #3D4C6C;
    --goldbg: #3A3010;
    --goldink: #FFD86B;
    --warnbg: #3A2A14;
    --warnink: #FFC58A;
    --stamp: #E5604A;
    color-scheme: dark;
  }
  :root:not([data-theme=light]),
  :root:not([data-theme=light]) [data-city] {
    --ct: color-mix(in srgb,var(--c) 18%,var(--surface));
    --cs: color-mix(in srgb,var(--c) 30%,var(--surface));
    --ci: color-mix(in srgb,var(--c) 58%,#fff);
  }
}
html {
  scroll-padding-top: env(safe-area-inset-top,0px);
  -webkit-text-size-adjust: 100%;
}
[data-city=tokyo] {
  --c: #3D63D8;
  --on: #fff;
}
[data-city=shizuoka] {
  --c: #287F45;
  --on: #fff;
}
[data-city=kyoto] {
  --c: #8657C7;
  --on: #fff;
}
[data-city=osaka] {
  --c: #E2701A;
  --on: #16213A;
}
[data-city=sendai] {
  --c: #0E7F87;
  --on: #fff;
}
[data-city=hakodate] {
  --c: #C23A6E;
  --on: #fff;
}
*,
*::before,
*::after {
  box-sizing: inherit;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--fr);
  font-size: 16px;
  line-height: 1.5;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
a {
  color: var(--ci);
}
:focus-visible {
  outline: 3px solid color-mix(in srgb,var(--c) 70%,#fff);
  outline-offset: 2px;
  border-radius: 6px;
}
.jp {
  font-family: var(--fj);
}
.muted {
  color: var(--muted);
}
.sm {
  font-size: 13px;
}
p {
  margin: 0;
}
.ic {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.ic.gold {
  color: var(--gold);
  fill: var(--gold);
}
.ic.ok {
  color: var(--ok);
}
/* shared components */
.chk {
  display: inline-flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  line-height: 1.35;
}
.chk .box {
  flex: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line2);
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: transparent;
  transition: background .12s;
}
.chk[aria-checked=true] .box {
  background: var(--c);
  border-color: var(--c);
  color: var(--on);
}
.chk .box .ic {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}
.chk .lbl b {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.chk[aria-checked=true] .lbl {
  color: var(--muted);
}
.chk.big .box {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}
.chk.sm .box {
  width: 22px;
  height: 22px;
}
.chk.pill {
  padding: 8px 14px 8px 10px;
  border: 1.5px solid var(--line2);
  border-radius: 999px;
  align-items: center;
  font-weight: 700;
}
.chk.pill[aria-checked=true] {
  background: var(--ct);
  border-color: var(--c);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--s2);
  border: 1px solid var(--line);
  color: var(--ink2);
}
.tag.gold {
  background: var(--goldbg);
  border-color: var(--gold);
  color: var(--goldink);
}
.tag .ic {
  width: 14px;
  height: 14px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.chip {
  font-size: 13.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--ct);
  color: var(--ci);
  border: 1px solid var(--cs);
}
.btnchip {
  background: var(--surface);
  color: var(--ink2);
  border-color: var(--line2);
  min-height: 34px;
}
.btnchip.sel {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--line2);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  min-height: 42px;
}
.btn.solid {
  background: var(--c);
  border-color: var(--c);
  color: var(--on);
}
.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn.ghost:hover {
  background: var(--s2);
}
.btn[disabled] {
  opacity: .4;
  cursor: default;
}
.mini {
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.mini .ic {
  width: 14px;
  height: 14px;
}
.iconbtn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  color: var(--ci);
  text-decoration: none;
}
.iconbtn:hover {
  background: var(--ct);
}
.ctag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--c);
  color: var(--on);
}
.callout {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ct);
  border-left: 5px solid var(--c);
  margin: 14px 0;
}
.callout b {
  display: block;
}
.callout.warn {
  background: var(--warnbg);
  border-color: #E08A1E;
  color: var(--warnink);
}
.callout.good {
  background: color-mix(in srgb,var(--ok) 12%,var(--surface));
  border-color: var(--ok);
}
.note {
  font-size: 14px;
  color: var(--warnink);
  margin-top: 4px;
}
.rows {
  margin: 12px 0;
}
.row {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.row dt {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-family: var(--fd);
  font-weight: 700;
  color: var(--ci);
}
.row dd {
  margin: 0;
}
.rows.rules .row dt {
  color: var(--muted);
}
.part+.part {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--line);
}
.part-h {
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--fd);
  font-size: 20px;
  margin: 0 0 8px;
}
.maplink {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
details.depth {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 16px;
  background: var(--surface);
}
details.depth summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  font-weight: 700;
}
details.depth summary::-webkit-details-marker {
  display: none;
}
details[open] summary .ic {
  transform: rotate(180deg);
}
.journal {
  margin-top: 28px;
}
.moods {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.moods button {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  font-size: 22px;
  background: var(--surface);
}
.moods button[aria-checked=true] {
  background: var(--ct);
  border-color: var(--c);
}
.fld {
  display: block;
  margin: 10px 0;
}
.fld span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
textarea,
input[type=search],
input[type=date],
input[type=time],
.m-search,
#amt,
#note,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line2);
  border-radius: 10px;
  background: var(--surface);
  resize: vertical;
}
.trio {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 10px;
}
.mp {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
  padding: 16px;
  border-radius: 14px;
  background: var(--ct);
}
.mp.col {
  grid-template-columns: 1fr;
  background: none;
  padding: 0;
  margin: 0;
}
.anchor-panel {
  margin-top: 14px;
}

.a-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}
.a-head h2 {
  font-family: var(--fd);
  font-size: 28px;
  line-height: 1.15;
  margin: 0 0 4px;
}
.a-meta {
  color: var(--ink2);
}
.a-cd {
  text-align: right;
  color: var(--muted);
  white-space: nowrap;
}
.cd {
  display: block;
  font-family: var(--fd);
  font-size: 30px;
  font-weight: 800;
  color: var(--ci);
}
.a-mission,
.body {
  line-height: 1.6;
}
.spec {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(170px,1fr));
  gap: 10px;
  margin: 14px 0;
}
.spec div {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--s2);
  border: 1px solid var(--line);
}
.spec dt {
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}
.spec dd {
  margin: 2px 0 0;
  font-weight: 700;
}
.spec small {
  display: block;
  font-weight: 400;
  color: var(--muted);
}
.brief {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--s2);
  margin: 10px 0;
  border-left: 5px solid var(--line2);
}
.brief.good {
  border-color: var(--ok);
}
.brief.warn {
  border-color: #E08A1E;
  background: var(--warnbg);
  color: var(--warnink);
}
.brief b {
  display: block;
}
h3 {
  font-family: var(--fd);
  font-size: 19px;
  margin: 26px 0 8px;
}
.checks {
  display: grid;
  gap: 12px;
}
.city .c-head {
  display: flex;
  gap: 16px;
  align-items: center;
}
.c-head .jp {
  font-size: 46px;
  font-weight: 900;
  color: var(--c);
  line-height: 1;
}
.c-head h2 {
  font-family: var(--fd);
  font-size: 32px;
  margin: 0;
}
.job {
  margin: 10px 0;
}
.trio3 {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
  gap: 12px;
  margin: 14px 0;
}
.trio3>div {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--s2);
  border: 1px solid var(--line);
}
.trio3 small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}
.trio3 b {
  display: block;
  margin: 2px 0;
}
.lane {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.lane span {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ct);
  font-size: 14px;
}
.lane b {
  margin-right: 6px;
  color: var(--ci);
}
.plain {
  margin: 0;
  padding-left: 20px;
}
.plain li {
  margin: 6px 0;
}
.logic {
  margin-top: 20px;
}
.eat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.eat p {
  color: var(--ink2);
  font-size: 15px;
}
.eat-r {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: right;
  font-weight: 700;
  color: var(--muted);
  flex: none;
}
.quest {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.quest.done {
  opacity: .55;
}
.q-main b {
  font-size: 17px;
}
.q-main p {
  color: var(--ink2);
}
.q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 6px;
}
.phrase {
  display: grid;
  grid-template-columns: minmax(120px,190px) 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.ph-jp {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}
.ro {
  display: block;
  color: var(--ci);
  font-weight: 700;
}
.ph-main p {
  color: var(--ink2);
  font-size: 14.5px;
}
.ph-act {
  display: flex;
  align-items: center;
  gap: 2px;
}
.phrase.learned {
  opacity: .6;
}
.kit {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.kit p {
  color: var(--ink2);
}
.tels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.plan {
  width: 100%;
  border-collapse: collapse;
}
.plan th,
.plan td {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.plan td {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}
.plan small {
  display: block;
  font-weight: 400;
  color: var(--muted);
}
.plan .tot th,
.plan .tot td {
  font-size: 18px;
  font-family: var(--fd);
}
.vrow {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.vs {
  flex: none;
  height: fit-content;
  font-size: 12.5px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb,var(--ok) 16%,var(--surface));
  color: var(--ok);
}
.vs.upd {
  background: var(--warnbg);
  color: var(--warnink);
}
.vl {
  display: flex;
  gap: 14px;
  margin-top: 4px;
}
.vrow p {
  color: var(--ink2);
  font-size: 15px;
}
.gate {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.gate p {
  color: var(--ink2);
}
.ready {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 0;
}
.ready b {
  font-family: var(--fd);
  font-size: 48px;
  line-height: 1;
  color: var(--ci);
}
.radars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.radar {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--s2);
  border: 1px solid var(--line);
}
.radar small {
  display: block;
  font-weight: 800;
  color: var(--muted);
}
.radar b {
  display: block;
  font-family: var(--fd);
  font-size: 18px;
}
.radar span {
  font-size: 13px;
  color: var(--ink2);
}
.packs {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(170px,1fr));
  gap: 12px;
}
.pack {
  padding: 12px;
  border-radius: 12px;
  background: var(--s2);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.pack b {
  font-family: var(--fd);
}
.modes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.modes button {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line2);
  font-weight: 700;
}
.modes button[aria-checked=true] {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.rh {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  margin: 6px 0;
  background: var(--s2);
  align-items: start;
}
.rh.now {
  background: var(--ct);
  outline: 2px solid var(--c);
}
.rh .t {
  font-family: var(--fd);
  font-weight: 800;
  color: var(--ci);
}
.rh p {
  color: var(--ink2);
  font-size: 15px;
}
.bingo {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 6px;
}
.bsq {
  aspect-ratio: 1;
  padding: 6px;
  border-radius: 12px;
  border: 1.5px solid var(--line2);
  background: var(--surface);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.bsq b {
  font-size: 12px;
  line-height: 1.15;
}
.bsq span {
  font-size: 10.5px;
  line-height: 1.2;
  color: var(--muted);
}
.bsq.on {
  background: var(--ct);
  border-color: var(--c);
}
.bsq.line {
  background: var(--c);
  color: var(--on);
  border-color: var(--c);
}
.bsq.line span {
  color: inherit;
  opacity: .85;
}
.stamps {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(96px,1fr));
  gap: 14px;
}
.stampcell {
  text-align: center;
}
.stampcell small {
  display: block;
  font-weight: 700;
}
.stamp {
  width: 100%;
  max-width: 120px;
  height: auto;
}
.stamp.inked {
  filter: url(#rough);
  animation: thunk .4s cubic-bezier(.2,1.6,.4,1);
}
.badges {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(230px,1fr));
  gap: 10px;
}
.badge {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px dashed var(--line2);
  color: var(--muted);
}
.badge.on {
  border: 1.5px solid var(--gold);
  background: var(--goldbg);
  color: var(--goldink);
}
.badge.on .ic {
  color: var(--gold);
  fill: var(--gold);
}
.badge b,
.badge span {
  display: block;
}
.badge span {
  font-size: 13.5px;
}
.badge em {
  font-size: 13px;
  font-weight: 700;
  font-style: normal;
}
.rank {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 16px;
  background: var(--ct);
  border: 1px solid var(--cs);
}
.rank>.jp {
  font-size: 44px;
  font-weight: 900;
  color: var(--ci);
}
.rank>div:nth-child(2) {
  flex: 1;
}
.rank b {
  font-family: var(--fd);
  font-size: 24px;
  display: block;
}
.rank span {
  color: var(--ink2);
}
.streak {
  text-align: center;
  color: #D9530B;
}
.streak b {
  font-size: 28px;
}
.streak span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.bar {
  height: 10px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
  margin: 8px 0;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--c);
  border-radius: 99px;
  transition: width .5s;
}
.stats3 {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
}
.stats3>div {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.stats3 small {
  color: var(--muted);
  font-weight: 700;
}
.stats3 b {
  display: block;
  font-family: var(--fd);
  font-size: 28px;
}
.neg {
  color: var(--danger);
}
.ex {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.ex b {
  min-width: 90px;
  font-family: var(--fd);
}
.ex .muted {
  flex: 1;
}
.spendform {
  display: grid;
  grid-template-columns: 160px 130px 1fr auto;
  gap: 8px;
  margin: 12px 0;
}
.mini-in {
  width: 70px;
  padding: 4px 8px;
  border: 1.5px solid var(--line2);
  border-radius: 8px;
  background: var(--surface);
}
.settings .srow {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.srow.col {
  flex-direction: column;
  align-items: stretch;
}
.inl {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.seg {
  display: inline-flex;
  border: 1.5px solid var(--line2);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.seg button {
  padding: 8px 16px;
  font-weight: 700;
}
.seg button[aria-pressed=true] {
  background: var(--ink);
  color: var(--surface);
}
.facts>div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.facts dt {
  font-family: var(--fd);
  font-weight: 700;
  color: var(--ci);
}
.facts dd {
  margin: 0;
}
.facts .warn {
  color: var(--warnink);
}
.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
  gap: 12px;
}
.flow>* {
  text-align: left;
  padding: 14px;
  border-radius: 12px;
  background: var(--ct);
  border: 1px solid var(--cs);
}
.flow .jp {
  font-size: 26px;
  font-weight: 900;
  color: var(--ci);
  display: block;
}
.flow p {
  color: var(--ink2);
  font-size: 15px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(130px,1fr));
  gap: 12px;
  margin: 18px 0;
}
.metrics b {
  font-family: var(--fd);
  font-size: 32px;
  display: block;
  line-height: 1;
}
.metrics span {
  font-weight: 700;
}
.metrics small {
  display: block;
  color: var(--muted);
}
.stub {
  text-align: left;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--line2);
  border-left: 6px solid var(--c);
  display: grid;
  gap: 2px;
  position: relative;
}
.stub.sel {
  background: var(--ct);
}
.stub.event-stub {
  border-left-color: var(--gold);
}
.stub b {
  font-family: var(--fd);
  font-size: 18px;
}
.stub span,
.stub small {
  color: var(--ink2);
  font-size: 14px;
}
.stub em {
  font-style: normal;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 20px;
  color: var(--ci);
}
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom,0px));
  transform: translate(-50%,20px);
  background: var(--ink);
  color: var(--surface);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 99;
  max-width: 92vw;
  text-align: center;
}
#toast.on {
  opacity: 1;
  transform: translate(-50%,0);
}
.conf {
  position: fixed;
  top: 55%;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  z-index: 98;
  pointer-events: none;
  animation: conf 1.2s ease-out forwards;
}
@keyframes conf {
  to { transform: translate(var(--dx),var(--dy)) rotate(var(--r)); opacity: 0; }
}
@keyframes thunk {
  from { transform: scale(1.6) rotate(-12deg); opacity: 0; }
}
@media (prefers-reduced-motion:reduce) {
  * {
    animation: none!important;
    transition: none!important;
  }
}
.pal-list button {
  display: flex;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  align-items: center;
}
.pal-list button:hover {
  background: var(--s2);
}
.pal-list .k {
  font-size: 12px;
  font-weight: 800;
  color: var(--ci);
  background: var(--ct);
  padding: 2px 8px;
  border-radius: 6px;
  min-width: 70px;
  text-align: center;
}
.hscroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
}
.hscroll .chip {
  flex: none;
}
/* ================= DESKTOP: squared guidebook ================= */
[data-ui=desktop] body {
  font-family: var(--ft);
  font-size: 17px;
}
[data-ui=desktop] .d-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
.d-side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--fd);
}
.d-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 8px;
}
.mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-family: var(--fj);
  font-weight: 800;
}
.d-brand b {
  font-size: 20px;
  display: block;
  line-height: 1.1;
}
.d-brand small {
  color: var(--muted);
}
.d-status {
  margin: 0 4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--ct);
  border-left: 4px solid var(--c);
  display: grid;
  font-size: 14px;
}
.d-status b {
  font-size: 16px;
}
.d-status span,
.d-status em {
  color: var(--ink2);
  font-style: normal;
}
.d-nav {
  display: grid;
  gap: 2px;
}
.grp {
  margin: 12px 8px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.navi {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
  text-align: left;
  width: 100%;
  font-size: 15.5px;
}
.navi:hover {
  background: var(--s2);
}
.navi.sel {
  background: var(--ink);
  color: var(--surface);
}
.navi kbd {
  margin-left: auto;
  font-family: var(--fd);
  font-size: 12px;
  padding: 0 6px;
  border: 1px solid var(--line2);
  border-radius: 4px;
  color: var(--muted);
}
.d-foot {
  margin-top: auto;
  display: grid;
  gap: 2px;
}
.d-foot .sm {
  padding: 6px 10px;
}
.d-main {
  min-width: 0;
  outline: none;
}
.d-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 44px 100px;
}
.d-page.wide {
  max-width: 1280px;
  padding-top: 0;
}
.d-page h1 {
  font-family: var(--fd);
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 0 0 8px;
  font-weight: 800;
}
.d-head {
  margin-bottom: 22px;
}
.d-head .meta {
  font-family: var(--fd);
  font-weight: 600;
  color: var(--ci);
}
.lede {
  font-size: 19px;
  color: var(--ink2);
  max-width: 60ch;
  margin-top: 10px;
  line-height: 1.55;
}
.d-page h2.h {
  font-family: var(--fd);
  font-size: 24px;
  margin: 36px 0 10px;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.d-page h2.h small {
  color: var(--muted);
  font-size: 16px;
}
.d-page .body,
.d-page .row dd,
.d-page .eat p,
.d-page .kit p,
.d-page .q-main p {
  font-size: 17px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 26px;
}
.grid2.top {
  grid-template-columns: 1.5fr 1fr;
}
.now {
  padding: 20px 22px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 6px solid var(--c);
}
.now-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--fd);
  color: var(--ci);
}
.now h2 {
  font-family: var(--fd);
  font-size: 26px;
  margin: 6px 0 8px;
  line-height: 1.2;
}
.now-act {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  align-items: center;
}
.stubs {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.d-page .stub {
  cursor: pointer;
}
.routeline {
  margin: 26px 0 8px;
  padding: 18px 18px 6px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow-x: auto;
}
.rl-cities,
.rl-days {
  display: grid;
  grid-template-columns: repeat(18,minmax(44px,1fr));
  min-width: 860px;
}
.rl-city {
  padding: 6px 8px;
  background: var(--c);
  color: var(--on);
  font-family: var(--fd);
  text-align: left;
  margin: 0 1px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.rl-city small {
  opacity: .85;
  font-size: 12px;
}
.rl-days {
  position: relative;
  margin-top: 26px;
  padding-bottom: 26px;
}
.rl-days::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 11px;
  height: 4px;
  background: var(--line2);
  border-radius: 2px;
}
.rl-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 10px;
  font-family: var(--fd);
}
.rl-day i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--c);
  position: relative;
  z-index: 1;
}
.rl-day.done i {
  background: var(--c);
}
.rl-day b {
  font-size: 14px;
  margin-top: 4px;
}
.rl-day small {
  color: var(--muted);
  font-size: 12px;
}
.rl-day.now i {
  box-shadow: 0 0 0 5px color-mix(in srgb,var(--c) 30%,transparent);
}
.rl-here {
  position: absolute;
  top: 100%;
  margin-top: -6px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--surface);
  z-index: 2;
  left: 0;
}
.rl-star {
  position: absolute;
  bottom: 100%;
  margin-bottom: -2px;
  color: var(--gold);
}
.rl-star .ic {
  fill: var(--gold);
  width: 18px;
  height: 18px;
}
.rl-day.anchor i {
  border-color: var(--gold);
  background: var(--gold);
}
.rl-day.event i {
  border-color: var(--gold);
  background: var(--surface);
}
.rl-event {
  color: var(--gold)!important;
}
.split {
  display: grid;
  grid-template-columns: 292px minmax(0,1fr);
  gap: 0;
  align-items: start;
}
.dlist {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow: auto;
  padding: 28px 14px 40px 0;
  font-family: var(--fd);
}
.ddetail {
  padding: 36px 0 100px 36px;
  max-width: 820px;
}
.dl-group h3 {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 16px 0 4px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--c);
  color: var(--on);
  font-size: 15px;
}
.dl-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border-radius: 8px;
}
.dl-row:hover {
  background: var(--s2);
}
.dl-row.sel {
  background: var(--ct);
  outline: 2px solid var(--c);
}
.dl-row .n {
  font-weight: 800;
  width: 26px;
  text-align: center;
  font-size: 17px;
}
.dl-row .t {
  flex: 1;
  min-width: 0;
}
.dl-row b {
  display: block;
  font-size: 14.5px;
  line-height: 1.25;
}
.dl-row small {
  color: var(--muted);
}
.dl-row.done .t b {
  color: var(--muted);
}
.dl-row .ic {
  width: 16px;
  height: 16px;
}
.dd-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 20px 22px;
  border-radius: 12px;
  background: var(--c);
  color: var(--on);
  margin-bottom: 24px;
}
.dd-head .tag {
  background: rgba(255,255,255,.18);
  border-color: transparent;
  color: inherit;
}
.dd-head .tag.gold {
  background: var(--gold);
  color: #3b2a00;
}
.dd-n b {
  font-family: var(--fd);
  font-size: 68px;
  line-height: .9;
  display: block;
  font-weight: 800;
}
.dd-n small {
  font-family: var(--fd);
  font-weight: 700;
}
.dd-t p {
  font-family: var(--fd);
  font-weight: 600;
}
.dd-t h1 {
  font-size: 34px!important;
  margin: 4px 0 0!important;
}
.dd-head .chk.pill {
  background: var(--surface);
  color: var(--ink);
  border-color: transparent;
}
.dd-head .chk .box {
  border-color: var(--line2);
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
}
.ctabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.ctab {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--line2);
  font-family: var(--fd);
  font-weight: 700;
  background: var(--surface);
}
.ctab.sel {
  background: var(--c);
  border-color: var(--c);
  color: var(--on);
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar input {
  max-width: 260px;
}
.rollbox {
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--ct);
  border: 2px solid var(--c);
  margin: 12px 0;
  display: grid;
  gap: 6px;
}
.rollbox b {
  font-family: var(--fd);
  font-size: 22px;
}
.rollbox .btn {
  justify-self: start;
}
.eatgroup {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: start;
}
.eatgroup .ctag {
  margin-top: 14px;
}
.mpgrid {
  display: grid;
  gap: 4px;
}
.mprow {
  display: grid;
  grid-template-columns: 60px 1fr 1fr;
  gap: 14px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  align-items: start;
  font-family: var(--fd);
}
.pal-back {
  position: fixed;
  inset: 0;
  background: rgba(10,16,30,.5);
  z-index: 90;
}
.pal {
  position: fixed;
  top: 14vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px,92vw);
  background: var(--surface);
  border-radius: 14px;
  padding: 12px;
  z-index: 91;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  font-family: var(--fd);
}
.pal input {
  font-size: 18px;
  margin-bottom: 6px;
}
.pal-list {
  max-height: 52vh;
  overflow: auto;
}
[data-ui=desktop] .m-shell,
[data-ui=desktop] .m-tabs {
  display: none;
}
@media (max-width:1180px) {
  .grid2,
  .grid2.top {
    grid-template-columns: 1fr;
  }
  .split {
    grid-template-columns: 250px 1fr;
  }
  .d-page {
    padding: 32px 28px 80px;
  }
}
/* ================= MOBILE: rounded game app ================= */
[data-ui=mobile] body {
  font-family: var(--fr);
  font-size: 16px;
}
.m-shell {
  min-height: 100vh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom,0px));
}
.m-shell.notabs {
  padding-bottom: calc(100px + env(safe-area-inset-bottom,0px));
}
.m-top {
  position: sticky;
  top: env(safe-area-inset-top,0px);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: color-mix(in srgb,var(--bg) 88%,transparent);
  backdrop-filter: blur(12px);
}
.m-top h1 {
  font-family: var(--fd);
  font-size: 22px;
  margin: 0;
  flex: 1;
  font-weight: 800;
}
.m-back {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 2px solid var(--line);
  margin-right: 2px;
}
.m-back[disabled] {
  opacity: .3;
}
.m-chips {
  display: flex;
  gap: 6px;
}
.m-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--line);
  font-weight: 900;
}
.m-chip.fire {
  color: #D9530B;
}
.m-chip.xp {
  color: var(--goldink);
  background: var(--goldbg);
  border-color: var(--gold);
}
.m-chip.xp em {
  font-style: normal;
  font-family: var(--fj);
  font-size: 12px;
}
.m-chip .ic {
  width: 18px;
  height: 18px;
}
.m-chip.fire .ic {
  fill: #F59E0B;
}
.m-chip.xp .ic {
  fill: var(--gold);
}
.m-hero {
  margin: 4px 12px 0;
  padding: 18px 18px 16px;
  border-radius: 28px;
  background: var(--c);
  color: var(--on);
  border-bottom: 6px solid color-mix(in srgb,var(--c) 70%,#000);
}
.m-ht {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  opacity: .9;
  font-size: 14px;
}
.m-day {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}
.m-day b {
  font-family: var(--fd);
  font-size: 72px;
  line-height: .95;
  font-weight: 800;
}
.m-day small {
  font-weight: 700;
  font-size: 16px;
}
.m-hero h2 {
  font-family: var(--fd);
  font-size: 25px;
  line-height: 1.15;
  margin: 2px 0 4px;
  font-weight: 800;
}
.m-hm {
  opacity: .9;
  font-size: 14.5px;
}
.m-hero .tag {
  background: rgba(255,255,255,.2);
  border-color: transparent;
  color: inherit;
}
.m-hero .tag.gold {
  background: var(--gold);
  color: #3b2a00;
}
.m-xpbar {
  height: 14px;
  border-radius: 99px;
  background: rgba(0,0,0,.25);
  overflow: hidden;
  margin-top: 14px;
}
.m-xpbar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(#FFE08A,#F0B100);
}
.m-xpl {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
  opacity: .95;
}
.m-body {
  padding: 12px 12px 0;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 12px;
  align-content: start;
}
.m-body>* {
  min-width: 0;
}
.m-card {
  padding: 16px;
  border-radius: 22px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
}
.m-card.now small,
.m-card.tmr small {
  font-weight: 800;
  color: var(--ci);
}
.m-card b {
  display: block;
  font-family: var(--fd);
  font-size: 18px;
}
.m-card p {
  color: var(--ink2);
}
.m-h {
  font-family: var(--fd);
  font-size: 20px;
  margin: 10px 4px -2px;
}
.tools {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 8px;
}
.tools button {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 4px;
  border-radius: 18px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ci);
}
.tools .ic {
  width: 26px;
  height: 26px;
}
.m-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 16px;
  font-weight: 900;
  background: var(--c);
  color: var(--on);
  border-bottom: 5px solid color-mix(in srgb,var(--c) 65%,#000);
  text-decoration: none;
  font-size: 16px;
}
.m-btn:active {
  transform: translateY(3px);
  border-bottom-width: 2px;
}
.m-btn.ghost {
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
}
.m-btn.big {
  min-height: 58px;
  font-size: 18px;
  width: 100%;
  margin-top: 14px;
}
.m-btn.wide {
  width: 100%;
}
.m-btn.done {
  background: var(--ok);
  border-bottom-color: #14633F;
  color: #fff;
}
.plan .chips {
  margin-top: 12px;
}
.bcs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2px 12px 10px;
  margin: 0 -12px;
  scrollbar-width: none;
}
.bc {
  flex: none;
  width: 78%;
  scroll-snap-align: center;
  padding: 14px 16px;
  border-radius: 22px;
  background: var(--ct);
  border: 2px solid var(--cs);
  border-bottom-width: 4px;
}
.bc h4 {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--fd);
  font-size: 18px;
  margin: 0 0 6px;
  color: var(--ci);
}
.bc p {
  font-size: 16px;
  line-height: 1.45;
}
.bc .ctag {
  float: right;
}
.m-stub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 14px 16px;
  border-radius: 22px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-left: 10px solid var(--c);
  border-bottom-width: 4px;
}
.m-stub b {
  font-family: var(--fd);
  font-size: 19px;
  display: block;
}
.m-stub span,
.m-stub small {
  display: block;
  color: var(--ink2);
  font-size: 14px;
}
.m-stub em {
  font-style: normal;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 24px;
  color: var(--ci);
}
.path {
  gap: 6px;
  padding-bottom: 20px;
}
.unit {
  margin-top: 14px;
}
.unit-h {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-radius: 20px;
  background: var(--c);
  color: var(--on);
  border-bottom: 5px solid color-mix(in srgb,var(--c) 65%,#000);
}
.unit-h>div {
  flex: 1;
}
.unit-h b {
  font-family: var(--fd);
  font-size: 20px;
  display: block;
}
.unit-h small {
  opacity: .9;
}
.unit-h .jp {
  font-size: 30px;
  font-weight: 900;
}
.track {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 0 4px;
  position: relative;
}
.track::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0;
  border-left: 4px dotted var(--line2);
}
.node {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  transform: translateX(var(--off));
  width: 210px;
}
.nb {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--fd);
  font-weight: 800;
  font-size: 22px;
  background: var(--surface);
  border: 3px solid var(--line2);
  border-bottom-width: 7px;
  color: var(--muted);
  z-index: 1;
}
.node.done .nb {
  background: var(--c);
  border-color: color-mix(in srgb,var(--c) 65%,#000);
  color: var(--on);
}
.node.next .nb,
.node.now .nb {
  background: var(--surface);
  border-color: var(--c);
  color: var(--ci);
  box-shadow: 0 0 0 7px color-mix(in srgb,var(--c) 25%,transparent);
}
.node.anchor .nb {
  background: var(--gold);
  border-color: #B98400;
  color: #3b2a00;
  border-radius: 22px;
}
.node.event .nb {
  background: var(--surface);
  border-color: var(--gold);
  color: var(--goldink);
  border-radius: 22px;
}
.node .nb .ic {
  width: 30px;
  height: 30px;
}
.node.anchor .nb .ic {
  fill: #3b2a00;
}
.node em {
  position: absolute;
  top: -14px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  z-index: 2;
}
.nl {
  text-align: center;
  background: color-mix(in srgb,var(--bg) 80%,transparent);
  padding: 0 6px;
  border-radius: 8px;
}
.nl b {
  font-size: 14.5px;
  line-height: 1.2;
  display: block;
}
.nl small {
  color: var(--muted);
}
.reward {
  display: grid;
  justify-items: center;
  padding: 12px 0;
}
.reward .stamp {
  width: 96px;
}
.reward small {
  color: var(--muted);
  font-weight: 700;
}
.reward.got small {
  color: var(--stamp);
}
.seg.wide {
  display: flex;
  border-radius: 16px;
  border-width: 2px;
}
.seg.wide button {
  flex: 1;
  padding: 12px 4px;
  font-weight: 900;
}
.rollrow {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 8px;
}
.rollrow .m-btn.big {
  margin: 0;
  font-size: 16px;
  padding: 0 8px;
}
.m-body .quest {
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  margin: 6px 0;
  background: var(--surface);
}
.m-body .bingo {
  gap: 5px;
}
.m-body .bsq {
  border-radius: 10px;
  padding: 4px;
}
.m-body .bsq b {
  font-size: 10.5px;
}
.m-body .bsq span {
  display: none;
}
.mplist {
  display: grid;
  gap: 8px;
}
.mplist .m-card {
  padding: 12px 14px;
}
.mplist small {
  font-weight: 800;
  color: var(--ci);
}
.wl-s {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  text-align: center;
}
.wl-s small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}
.wl-s b {
  font-size: 19px;
}
.amt {
  text-align: center;
}
.amt-n {
  font-family: var(--fd);
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
}
.amt-c {
  color: var(--ci);
  font-weight: 800;
  margin-bottom: 8px;
}
.cats {
  justify-content: center;
}
.keys {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 8px;
  margin-top: 6px;
}
.key {
  height: 58px;
  border-radius: 16px;
  background: var(--s2);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  font-family: var(--fd);
  font-size: 24px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.key:active {
  transform: translateY(2px);
}
.rowbtns {
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
}
.rowbtns .m-btn {
  padding: 0 8px;
  font-size: 14px;
}
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tiles button {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  font-weight: 800;
  text-align: left;
  font-size: 15px;
}
.tiles .ic {
  width: 26px;
  height: 26px;
  color: var(--ci);
}
.m-dayh {
  padding: calc(12px) 16px 18px;
  background: var(--c);
  color: var(--on);
  border-radius: 0 0 30px 30px;
  position: relative;
  border-bottom: 6px solid color-mix(in srgb,var(--c) 65%,#000);
}
.m-dt {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}
.m-dt>span {
  flex: 1;
}
.m-dt>div {
  display: flex;
  gap: 6px;
}
.m-dayh .m-back {
  background: rgba(255,255,255,.2);
  border-color: transparent;
  color: inherit;
}
.m-dayh h2 {
  font-family: var(--fd);
  font-size: 28px;
  line-height: 1.1;
  margin: 12px 0 0;
  font-weight: 800;
}
.m-dayh .tag {
  background: rgba(255,255,255,.2);
  border-color: transparent;
  color: inherit;
}
.m-dayh .tag.gold {
  background: var(--gold);
  color: #3b2a00;
}
.daybody .part .body {
  font-size: 17px;
}
.daybody .rows .row {
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 12px 14px;
  margin: 8px 0;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.daybody .rows.rules .row {
  background: none;
  border-style: dashed;
}
.daybody .trio {
  grid-template-columns: 1fr;
}
.daybody .mp {
  grid-template-columns: 1fr;
}
.m-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom,0px));
  background: color-mix(in srgb,var(--bg) 92%,transparent);
  backdrop-filter: blur(12px);
  z-index: 30;
}
.m-bar .m-btn {
  margin: 0;
}
.m-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5,1fr);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom,0px));
  background: var(--surface);
  border-top: 2px solid var(--line);
}
.m-tabs button {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 0;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.m-tabs .ic {
  width: 26px;
  height: 26px;
}
.m-tabs .sel {
  background: var(--ct);
  color: var(--ci);
}
.sheet-back {
  position: fixed;
  inset: 0;
  background: rgba(10,16,30,.55);
  z-index: 60;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  padding: 14px 20px calc(24px + env(safe-area-inset-bottom,0px));
  display: grid;
  gap: 10px;
  max-height: 85%;
  overflow: auto;
}
.sheet h2 {
  font-family: var(--fd);
  font-size: 26px;
  margin: 0;
}
.grab {
  width: 44px;
  height: 5px;
  border-radius: 9px;
  background: var(--line2);
  margin: 0 auto 6px;
}
.bigphrase {
  position: fixed;
  inset: 0;
  z-index: 61;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  background: var(--surface);
}
.bigphrase .jp {
  font-size: clamp(40px,14vw,84px);
  font-weight: 900;
  line-height: 1.2;
}
.bigphrase b {
  font-size: 22px;
  font-family: var(--fd);
}
.bigphrase span {
  color: var(--ci);
  font-weight: 800;
  font-size: 20px;
}
.bigphrase small {
  margin-top: 30px;
  color: var(--muted);
}
[data-ui=mobile] .d-shell {
  display: none;
}
[data-ui=mobile] .phrase {
  grid-template-columns: 1fr auto;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 20px;
  margin: 8px 0;
  background: var(--surface);
}
[data-ui=mobile] .ph-jp {
  grid-column: 1/-1;
  font-size: 28px;
}
[data-ui=mobile] .m-body .phrase.m-card {
  margin: 0;
}
[data-ui=mobile] .kit {
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 18px;
  margin: 8px 0;
  background: var(--surface);
}
[data-ui=mobile] .eat {
  padding: 6px 0 0;
  border: 0;
}
[data-ui=mobile] .m-card .ctag {
  margin-bottom: 4px;
}
[data-ui=mobile] .chk .lbl {
  font-size: 16px;
}
[data-ui=mobile] .journal textarea,
[data-ui=mobile] .m-search {
  font-size: 16px;
}
[data-ui=mobile] .rh {
  grid-template-columns: 1fr;
}
[data-ui=mobile] .facts>div {
  grid-template-columns: 1fr;
  gap: 2px;
}
[data-ui=mobile] .row {
  grid-template-columns: 1fr;
}
[data-ui=mobile] .a-head {
  flex-direction: column;
}
[data-ui=mobile] .a-cd {
  text-align: left;
}
[data-ui=mobile] .settings .srow {
  flex-direction: column;
  align-items: flex-start;
}
[data-ui=mobile] .stats3 {
  grid-template-columns: 1fr;
}
[data-ui=mobile] .m-body .d-head {
  margin: 2px 4px 12px;
}
[data-ui=mobile] .m-body .d-head h1 {
  font-size: 29px;
}
[data-ui=mobile] .m-body .d-head .lede {
  font-size: 15px;
}
[data-ui=mobile] .field-grid {
  grid-template-columns: 1fr;
}
[data-ui=mobile] .field-metrics {
  grid-template-columns: repeat(2,1fr);
}
/* ================= FIELD BOOK X — additive expedition layer ================= */
.field-hud {
  margin: 18px 0 26px;
  padding: 18px;
  border: 1.5px solid var(--cs);
  border-left: 7px solid var(--c);
  border-radius: 16px;
  background: linear-gradient(135deg,var(--surface),var(--ct));
  box-shadow: 0 12px 28px rgba(18,32,58,.06);
}
.field-hud-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.field-hud h2 {
  font-family: var(--fd);
  font-size: 22px;
  margin: 0 0 3px;
}
.field-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ci);
}
.field-metrics {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 8px;
  margin: 14px 0;
}
.field-metric {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.field-metric small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.field-metric b {
  font-family: var(--fd);
  font-size: 18px;
  display: block;
  margin-top: 2px;
}
.field-metric span {
  display: block;
  color: var(--ink2);
  font-size: 12.5px;
}
.field-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.field-mode {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--line2);
  background: var(--surface);
  font-weight: 800;
}
.field-mode.sel {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}
.field-mode.warn.sel {
  background: #9A5A08;
  border-color: #9A5A08;
  color: #fff;
}
.field-mode.good.sel {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.field-advice {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--s2);
  border: 1px solid var(--line);
}
.field-advice b {
  font-family: var(--fd);
  display: block;
}
.field-advice p {
  color: var(--ink2);
  margin-top: 2px;
}
.field-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.field-board {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin: 18px 0;
}
.field-panel {
  padding: 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.field-panel h3 {
  margin: 0 0 9px;
  font-size: 19px;
}
.field-panel .subhead {
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 14px 0 7px;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 9px;
}
.field-card {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--s2);
}
.field-card b {
  font-family: var(--fd);
  display: block;
}
.field-card p {
  color: var(--ink2);
  font-size: 14px;
  margin-top: 3px;
}
.field-card em {
  display: inline-block;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ct);
  color: var(--ci);
  margin-bottom: 5px;
}
.field-stack {
  display: grid;
  gap: 7px;
}
.field-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--s2);
  align-items: start;
}
.field-block.done {
  opacity: .57;
}
.field-block .fb-meta {
  font-size: 11.5px;
  color: var(--ci);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.field-block b {
  font-family: var(--fd);
  font-size: 15px;
}
.field-block p {
  font-size: 13.5px;
  color: var(--ink2);
  margin-top: 2px;
}
.field-strip {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
}
.field-strip .field-card {
  min-width: 220px;
}
.field-linkrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.field-note {
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb,var(--gold) 12%,var(--surface));
  border: 1px solid color-mix(in srgb,var(--gold) 46%,var(--line));
  color: var(--goldink);
}
.field-note b {
  font-family: var(--fd);
}
.city-intel {
  margin-top: 18px;
}
.city-intel .field-grid {
  grid-template-columns: repeat(3,minmax(0,1fr));
}
.city-route {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(140px,1fr));
  gap: 8px;
  margin: 10px 0;
}
.city-route div {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--s2);
}
.city-route b {
  font-family: var(--fd);
  display: block;
}
.city-route span {
  color: var(--ink2);
  font-size: 13px;
}
.control-hero {
  padding: 20px 22px;
  border-radius: 18px;
  background: linear-gradient(135deg,var(--ink),color-mix(in srgb,var(--c) 42%,var(--ink)));
  color: #fff;
  margin-bottom: 18px;
}
.control-hero .field-kicker {
  color: rgba(255,255,255,.72);
}
.control-hero h1 {
  font-family: var(--fd);
  font-size: 34px;
  margin: 2px 0 5px;
}
.control-hero p {
  max-width: 72ch;
  color: rgba(255,255,255,.86);
}
.control-statrow {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 8px;
  margin-top: 16px;
}
.control-stat {
  padding: 11px;
  border-radius: 11px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
}
.control-stat small {
  display: block;
  color: rgba(255,255,255,.72);
  font-weight: 800;
}
.control-stat b {
  display: block;
  font-family: var(--fd);
  font-size: 21px;
}
.route-pulse {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 8px;
  margin: 12px 0;
}
.pulse-city {
  padding: 11px;
  border-radius: 12px;
  background: var(--ct);
  border: 1px solid var(--cs);
}
.pulse-city b {
  font-family: var(--fd);
  display: block;
}
.pulse-city span {
  font-size: 12.5px;
  color: var(--ink2);
}
.pulse-city i {
  display: block;
  height: 5px;
  border-radius: 99px;
  background: var(--line);
  margin-top: 7px;
  overflow: hidden;
}
.pulse-city i::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--p);
  background: var(--c);
  border-radius: 99px;
}
.solo-brief {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 10px;
}
.solo-brief>* {
  padding: 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--s2);
}
.solo-brief b {
  font-family: var(--fd);
  display: block;
}
.solo-brief p {
  color: var(--ink2);
  font-size: 14px;
  margin-top: 3px;
}
.field-divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}
@media (max-width:760px) {
  .field-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .field-board,
  .solo-brief {
    grid-template-columns: 1fr;
  }
  .field-grid,
  .city-intel .field-grid {
    grid-template-columns: 1fr;
  }
  .control-statrow {
    grid-template-columns: 1fr 1fr;
  }
  .route-pulse {
    grid-template-columns: 1fr 1fr;
  }
  .control-hero h1 {
    font-size: 28px;
  }
}
@media (min-width:761px) and (max-width:1100px) {
  .field-board {
    grid-template-columns: 1fr;
  }
  .city-intel .field-grid {
    grid-template-columns: 1fr 1fr;
  }
  .route-pulse {
    grid-template-columns: repeat(3,1fr);
  }
}
[data-ui=mobile] .field-hud {
  padding: 15px;
  border-radius: 20px;
}
.field-hud.mobile-tight {
  margin-top: 0;
}
.field-metrics.mobile {
  grid-template-columns: 1fr 1fr;
}
.field-grid.mobile {
  grid-template-columns: 1fr;
}
.field-panel.mobile {
  border-radius: 18px;
}
.field-block.mobile {
  border-radius: 14px;
}
.control-hero.mobile {
  border-radius: 0 0 24px 24px;
  margin: 0 -12px 12px;
  padding: 20px 16px;
}
/* ================= FIELD BOOK X — finishing polish ================= */
.field-hud,
.field-panel,
.control-hero,
.m-card,
.now,
.rank,
.stub,
.pack,
.badge {
  transition: transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
@media (hover:hover) {
  .field-card,
  .field-block,
  .field-panel,
  .field-hud,
  .m-card,
  .now,
  .stub,
  .pack,
  .badge {
    transition: transform .18s ease,box-shadow .18s ease,border-color .18s ease;
  }
  .field-card:hover,
  .field-block:hover,
  .pack:hover,
  .badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(18,32,58,.08);
    border-color: var(--line2);
  }
  .field-panel:hover,
  .field-hud:hover,
  .now:hover,
  .m-card:hover {
    box-shadow: 0 10px 24px rgba(18,32,58,.07);
  }
}
.field-kicker {
  user-select: none;
}
.control-hero {
  position: relative;
  overflow: hidden;
}
.control-hero::after {
  content: "";
  position: absolute;
  inset: auto -30px -42px auto;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 0 0 24px rgba(255,255,255,.035),0 0 0 48px rgba(255,255,255,.02);
  pointer-events: none;
}
.control-stat b {
  letter-spacing: -.02em;
}
.field-mode:active,
.btn:active,
.m-btn:active,
.field-card:active,
.field-block:active {
  transform: translateY(1px);
}
[data-ui=mobile] .field-actions .btn {
  flex: 1 1 calc(50% - 8px);
  justify-content: center;
}
[data-ui=mobile] .control-stat {
  padding: 10px;
}
@media (max-width:420px) {
  .control-statrow {
    grid-template-columns: 1fr 1fr;
  }
  .control-stat:last-child {
    grid-column: 1/-1;
  }
  .field-actions .btn {
    font-size: 14px;
    padding-inline: 11px;
  }
  .field-metric {
    padding: 9px 10px;
  }
  .field-metric b {
    font-size: 17px;
  }
}
/* ================= CONTROL ROOM — DARK MODE EYE-COMFORT ================= */
[data-theme=dark] .control-hero {
  background: linear-gradient(135deg,#151D2E,#202D46);
  color: #F2F5FA;
  border: 1px solid #33415C;
  box-shadow: 0 12px 30px rgba(0,0,0,.24);
}
[data-theme=dark] .control-hero .field-kicker {
  color: #B6C2D7;
}
[data-theme=dark] .control-hero h1 {
  color: #F7F9FC;
}
[data-theme=dark] .control-hero p {
  color: #D2D9E5;
}
[data-theme=dark] .control-stat {
  background: rgba(255,255,255,.055);
  border-color: #3A4862;
}
[data-theme=dark] .control-stat small {
  color: #AEBACD;
}
[data-theme=dark] .control-stat b {
  color: #F5F7FB;
}
[data-theme=dark] .control-hero::after {
  border-color: rgba(255,255,255,.07);
  box-shadow: 0 0 0 24px rgba(255,255,255,.018),0 0 0 48px rgba(255,255,255,.01);
}
[data-theme=dark] .control-hero + .field-hud {
  background: linear-gradient(135deg,#182236,#1D2940);
  border-color: #34425C;
}
[data-theme=dark] .control-hero + .field-hud .field-metric,
[data-theme=dark] .control-hero + .field-hud .field-card,
[data-theme=dark] .control-hero + .field-hud .field-panel,
[data-theme=dark] .control-hero + .field-hud .field-advice {
  background: #1A2538;
  border-color: #33415A;
}
[data-theme=dark] .control-hero + .field-hud .field-metric small,
[data-theme=dark] .control-hero + .field-hud .field-card p,
[data-theme=dark] .control-hero + .field-hud .field-advice p {
  color: #AEB9CB;
}
@media (prefers-color-scheme:dark) {
  :root:not([data-theme=light]) .control-hero {
    background: linear-gradient(135deg,#151D2E,#202D46);
    color: #F2F5FA;
    border-color: #33415C;
    box-shadow: 0 12px 30px rgba(0,0,0,.24);
  }
  :root:not([data-theme=light]) .control-hero .field-kicker {
    color: #B6C2D7;
  }
  :root:not([data-theme=light]) .control-hero h1 {
    color: #F7F9FC;
  }
  :root:not([data-theme=light]) .control-hero p {
    color: #D2D9E5;
  }
  :root:not([data-theme=light]) .control-stat {
    background: rgba(255,255,255,.055);
    border-color: #3A4862;
  }
  :root:not([data-theme=light]) .control-stat small {
    color: #AEBACD;
  }
  :root:not([data-theme=light]) .control-stat b {
    color: #F5F7FB;
  }
  :root:not([data-theme=light]) .control-hero::after {
    border-color: rgba(255,255,255,.07);
    box-shadow: 0 0 0 24px rgba(255,255,255,.018),0 0 0 48px rgba(255,255,255,.01);
  }
  :root:not([data-theme=light]) .control-hero + .field-hud {
    background: linear-gradient(135deg,#182236,#1D2940);
    border-color: #34425C;
  }
  :root:not([data-theme=light]) .control-hero + .field-hud .field-metric,
  :root:not([data-theme=light]) .control-hero + .field-hud .field-card,
  :root:not([data-theme=light]) .control-hero + .field-hud .field-panel,
  :root:not([data-theme=light]) .control-hero + .field-hud .field-advice {
    background: #1A2538;
    border-color: #33415A;
  }
}
@media print {
  body {
    background: #fff!important;
    color: #000!important;
  }
  .d-side,
  .m-top,
  .m-tabs,
  .m-bar,
  #toast,
  .pal,
  .pal-back,
  .sheet,
  .sheet-back,
  .bigphrase {
    display: none!important;
  }
  [data-ui=desktop] .d-shell {
    display: block;
  }
  [data-ui=desktop] .d-page {
    max-width: none;
    padding: 20px;
  }
  .field-hud,
  .field-panel,
  .control-hero,
  .m-card,
  .now,
  .rank,
  .stub,
  .pack,
  .badge {
    box-shadow: none!important;
  }
  a {
    color: inherit!important;
    text-decoration: none;
  }
}

/* ================= extensions: scroll progress, ambient wash, motion, field/guide/radar styles ================= */
/* scroll progress */
#sprog {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--c,#3D63D8);
  z-index: 80;
  border-radius: 0 3px 3px 0;
  transition: width .1s linear;
  pointer-events: none;
}
/* time-of-day ambient wash (subtle, additive) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s;
}
[data-tod="dawn"] body::after {
  opacity: 1;
  background: linear-gradient(180deg,rgba(255,158,120,.07),transparent 40%);
}
[data-tod="dusk"] body::after {
  opacity: 1;
  background: linear-gradient(180deg,rgba(255,170,80,.09),transparent 45%);
}
[data-tod="night"] body::after {
  opacity: 1;
  background: linear-gradient(180deg,rgba(30,50,110,.12),transparent 50%);
}
[data-theme=dark] body::after {
  opacity: .55;
}
#app {
  position: relative;
  z-index: 1;
}
/* page-enter motion */
@keyframes pagein {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.d-page {
  animation: pagein .38s cubic-bezier(.2,.8,.2,1);
}
.m-shell {
  animation: pagein .3s cubic-bezier(.2,.8,.2,1);
}
@media (prefers-reduced-motion:reduce) {
  .d-page,
  .m-shell {
    animation: none;
  }
}
/* falling leaves on the overview hero */
.hero-head {
  position: relative;
}
.leaves {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}
.leaf {
  position: absolute;
  top: -14px;
  left: calc(var(--lx)*1%);
  width: 11px;
  height: 11px;
  background: radial-gradient(circle at 30% 30%,#E8A33D,#C8412B);
  border-radius: 0 60% 0 60%;
  opacity: .8;
  transform: rotate(var(--lr)) scale(var(--ls));
  animation: leaf var(--lt) linear var(--ld) infinite;
}
.leaf:nth-child(2n) {
  background: radial-gradient(circle at 30% 30%,#F0B100,#B95F16);
}
.leaf:nth-child(3n) {
  background: radial-gradient(circle at 30% 30%,#D96B43,#8E3B2F);
}
@keyframes leaf {
  0% { transform: translate(0,-16px) rotate(var(--lr)) scale(var(--ls)); opacity: 0; }
  8% { opacity: .85; }
  70% { opacity: .7; }
  100% { transform: translate(34px,150px) rotate(calc(var(--lr) + 260deg)) scale(var(--ls)); opacity: 0; }
}
@media (prefers-reduced-motion:reduce) {
  .leaves {
    display: none;
  }
}
/* tabular numerals for anything that ticks */
.cd,
[data-count],
[data-live-clock],
.amt-n,
.metrics b,
.control-stat b {
  font-variant-numeric: tabular-nums;
}
/* day progress hairline */
.dayprog {
  height: 5px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
  margin: 2px 0 10px;
}
.dayprog i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg,var(--c),color-mix(in srgb,var(--c) 55%,#F0B100));
  border-radius: 99px;
  transition: width 1s linear;
}
/* day extras band */
.xband {
  margin: 20px 0 4px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(160deg,var(--ct),transparent 70%);
  border: 1px solid var(--cs);
}
.xgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 10px;
}
.xcell {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.xcell p {
  color: var(--ink2);
  font-size: 14.5px;
  margin-top: 4px;
}
.xtrap {
  background: var(--warnbg);
  border-color: color-mix(in srgb,#E08A1E 55%,var(--line));
}
.xtrap p {
  color: var(--warnink);
}
.xnight {
  background: color-mix(in srgb,#16213A 6%,var(--surface));
}
[data-theme=dark] .xnight {
  background: color-mix(in srgb,#3D63D8 10%,var(--surface));
}
.xw-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.xw-jp {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.1;
  display: block;
}
.xw-ro {
  display: block;
  font-weight: 800;
  color: var(--ci);
  font-size: 13.5px;
}
.xw-en {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.xmeta .mini {
  margin-top: 8px;
}
.xcell .fb-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11.5px;
  color: var(--ci);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.xcell .fb-meta .ic {
  width: 15px;
  height: 15px;
}
/* tonight panel */
.tonight {
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(120deg,#16213A,color-mix(in srgb,var(--c) 40%,#16213A));
  color: #fff;
}
.tonight .muted {
  color: rgba(255,255,255,.72);
}
.tn-h {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}
.tn-h b {
  font-family: var(--fd);
  font-size: 20px;
}
.tn-h .ic {
  color: var(--gold);
}
.tn-night {
  margin: 8px 0 4px;
  color: rgba(255,255,255,.92);
  font-size: 15.5px;
}
.tonight .field-linkrow .btn.ghost {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.3);
  color: #fff;
}
.m-card.tonight {
  background: linear-gradient(120deg,#16213A,color-mix(in srgb,var(--c) 45%,#16213A));
  color: #fff;
  border-color: transparent;
}
.m-card.tonight p {
  color: rgba(255,255,255,.85);
}
.m-card.tonight small {
  color: var(--gold);
  font-weight: 900;
}
.m-card.tonight .m-btn.ghost {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.28);
  color: #fff;
}
/* guides */
.guides {
  display: grid;
  gap: 12px;
}
details.guide {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
details.guide summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
}
details.guide summary::-webkit-details-marker {
  display: none;
}
details.guide summary:hover {
  background: var(--s2);
}
.g-jp {
  font-size: 34px;
  font-weight: 900;
  color: var(--ci);
  width: 96px;
  flex: none;
  text-align: center;
  background: var(--ct);
  border-radius: 12px;
  padding: 8px 4px;
}
.g-t {
  flex: 1;
  min-width: 0;
}
.g-t b {
  font-family: var(--fd);
  font-size: 21px;
  display: block;
}
.g-t span {
  color: var(--muted);
  font-size: 14.5px;
}
.g-chev {
  transition: transform .2s;
  color: var(--muted);
}
details.guide[open] .g-chev {
  transform: rotate(180deg);
}
.g-body {
  padding: 0 22px 20px;
  border-top: 1px solid var(--line);
}
.g-sec h3 {
  margin: 18px 0 4px;
}
.g-sec p {
  color: var(--ink2);
  font-size: 15.5px;
  line-height: 1.65;
}
[data-ui=mobile] .g-jp {
  width: 64px;
  font-size: 26px;
}
[data-ui=mobile] details.guide {
  border-radius: 20px;
  border-width: 2px;
}
/* radar */
.radarlist {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.radarcard {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--c);
  border-radius: 14px;
  background: var(--surface);
}
.radarcard.done {
  opacity: .6;
}
.rc-main {
  min-width: 0;
  flex: 1;
}
.rc-main>b {
  font-family: var(--fd);
  font-size: 17.5px;
  display: block;
  margin: 6px 0 2px;
}
.rc-main>p {
  color: var(--ink2);
  font-size: 15px;
}
.vl {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}
/* gacha */
.gachabox {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg,var(--goldbg),var(--surface));
  border: 1.5px solid var(--gold);
}
.gachabox .fb-meta {
  color: var(--goldink);
}
.gacha-pick {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.gacha-pick b {
  font-family: var(--fd);
  font-size: 19px;
  display: inline-block;
  margin-right: 8px;
}
.gacha-pick p {
  color: var(--ink2);
  margin-top: 4px;
}
/* yen breakdown + money charts */
.yenbk {
  margin: 8px 0;
}
.moneyx {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}
.mx-cell {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.mx-cell.wide {
  grid-column: 1/-1;
}
.mx-cell .fb-meta {
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ci);
  margin-bottom: 8px;
}
.mx-cell .stats3 {
  grid-template-columns: repeat(3,1fr);
}
.cbrow {
  display: grid;
  grid-template-columns: 84px 1fr 84px;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
  font-size: 14px;
}
.cbrow b {
  text-align: right;
  font-family: var(--fd);
}
.cbtrack {
  height: 10px;
  border-radius: 99px;
  background: var(--s2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.cbtrack i {
  display: block;
  height: 100%;
  background: var(--c);
  border-radius: 99px;
}
.dbars {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 110px;
  padding-top: 8px;
}
.dbcol {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.dbcol i {
  display: block;
  width: 100%;
  max-width: 34px;
  background: var(--cs);
  border-radius: 5px 5px 2px 2px;
  transition: height .4s;
}
.dbcol.now i {
  background: var(--c);
}
.dbcol small {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
}
[data-ui=mobile] .moneyx {
  grid-template-columns: 1fr;
}
/* rollbar */
.rollbar {
  margin: 6px 0 14px;
}
/* stamps get a hanko glow when inked */
.stamp.inked {
  filter: url(#rough) drop-shadow(0 2px 10px color-mix(in srgb,var(--stamp) 45%,transparent));
}
/* live clock chip */
.m-chip b {
  font-variant-numeric: tabular-nums;
}
/* rank seal flourish */
.rank>.jp {
  text-shadow: 0 2px 14px color-mix(in srgb,var(--c) 40%,transparent);
}
/* link buttons inside radar/guides keep tap size */
.vl .mini,
.g-body .mini {
  min-height: 30px;
}
@media print {
  #sprog,
  .leaves {
    display: none!important;
  }
  .d-page,
  .m-shell {
    animation: none;
  }
}

/* AUTH GATE — Only visible when private cloud sync is enabled and no user is signed in. */
#auth-gate { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
#auth-gate[hidden] { display: none; }
.auth-card { width: min(520px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 18px 60px rgba(0,0,0,.12); }
.auth-kicker { font: 800 12px/1 var(--fd); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }
.auth-card h1 { margin: 0 0 10px; }
.auth-form { display: grid; gap: 10px; margin-top: 22px; }
.auth-form label { font-weight: 700; font-size: 14px; }
.auth-form input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; box-sizing: border-box; }
.auth-form .btn { width: 100%; justify-content: center; }
.auth-code-row { display: flex; gap: 8px; align-items: end; }
.auth-code-row > div { flex: 1; }
.auth-code-row .btn { width: auto; min-width: 120px; }
.auth-status { min-height: 1.4em; margin: 12px 0 0; font-weight: 650; }
.auth-status[data-kind=error] { color: var(--danger); }
.auth-status[data-kind=success] { color: var(--ok); }
@media (max-width: 540px) {
  .auth-card { padding: 22px; border-radius: 16px; }
  .auth-code-row { display: grid; grid-template-columns: 1fr; }
  .auth-code-row .btn { width: 100%; }
}
