/* ---------- Theme tokens ---------- */
:root {
  --bg-primary: #fffdf8;
  --bg-secondary: #f6efe4;
  --bg-tertiary: #efe4d3;
  --text-primary: #2a211c;
  --text-secondary: #5c4f46;
  --text-muted: #8a7b70;
  --border-color: #e6d8c4;
  --accent-color: #c4402a;
  --accent-hover: #a5321f;
  --accent-soft: #fbe2da;
  --on-accent: #ffffff;
  --indigo: #2e3f6e;
  --indigo-soft: #e2e7f3;
  --gold: #a87a22;
  --gold-soft: #f6e9cc;
  --moss: #4b6d3f;
  --moss-soft: #e1ebd8;
  --sun: #d9442b;
  --hill-back: #e7c9a6;
  --hill-front: #d6a77a;
  --torii: #b8331f;
  --fuji: #50618c;
  --snow: #fffdf8;
  --lake: #9fb4d6;
  --shadow-color: rgba(70, 45, 20, 0.10);
  --shadow-strong: rgba(70, 45, 20, 0.18);
  --toggle-bg: #efe4d3;
  --overlay: rgba(25, 18, 12, 0.88);
  --grid-color: rgba(90, 60, 25, 0.08);
  --grid-size: 28px;
  --grid-dot: 1px;
  --radius: 18px;
  --radius-sm: 12px;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-jp: 'Noto Serif JP', 'Hiragino Mincho ProN', serif;
}

[data-theme="dark"] {
  --bg-primary: #1d1a22;
  --bg-secondary: #131118;
  --bg-tertiary: #29242f;
  --text-primary: #efe7dc;
  --text-secondary: #c6bbae;
  --text-muted: #918679;
  --border-color: #342e3b;
  --accent-color: #ff7a5c;
  --accent-hover: #ff9a82;
  --accent-soft: #3b211c;
  --on-accent: #1b100c;
  --indigo: #aebcea;
  --indigo-soft: #232a42;
  --gold: #e6bd68;
  --gold-soft: #352b17;
  --moss: #a3cb92;
  --moss-soft: #1f2b1c;
  --sun: #ff6a4d;
  --hill-back: #3a2f3f;
  --hill-front: #2a2230;
  --torii: #ff6a4d;
  --fuji: #3e4870;
  --snow: #e9e6f2;
  --lake: #2c3552;
  --shadow-color: rgba(0, 0, 0, 0.40);
  --shadow-strong: rgba(0, 0, 0, 0.60);
  --toggle-bg: #29242f;
  --overlay: rgba(6, 5, 9, 0.92);
  --grid-color: rgba(255, 255, 255, 0.06);
}

/* Theme switch fades only while toggling, so it never fights component transitions. */
.theme-anim, .theme-anim * {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease, fill .3s ease !important;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--grid-color) var(--grid-dot), transparent var(--grid-dot));
  background-size: var(--grid-size) var(--grid-size);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 70%);
}
main, .footer { position: relative; z-index: 1; }
img { max-width: 100%; display: block; }
a { color: var(--accent-color); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
.jp { font-family: var(--font-jp); }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--text-primary); color: var(--bg-primary); font-weight: 700; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-secondary) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border-color);
}
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text-primary); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-mark circle { fill: var(--accent-color); }
.brand-mark path { stroke: var(--on-accent); stroke-width: 5; stroke-linecap: round; fill: none; }
.topnav { display: none; margin-left: auto; gap: 4px; }
.topnav a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 12px; border-radius: 999px; }
.topnav a:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.topnav a.active { background: var(--text-primary); color: var(--bg-primary); }
.topnav .nav-ic { font-size: 15px; }

/* Phone bottom navigation */
.bottomnav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg-primary) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--border-color);
}
.bottomnav a { display: grid; justify-items: center; gap: 1px; padding: 4px 2px; border-radius: 12px; text-decoration: none; color: var(--text-muted); font-size: 11px; font-weight: 700; }
.bottomnav .nav-ic { font-size: 21px; line-height: 1.2; filter: grayscale(.6); opacity: .8; }
.bottomnav a.active { color: var(--accent-color); background: var(--accent-soft); }
.bottomnav a.active .nav-ic { filter: none; opacity: 1; }
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .bottomnav { display: none; }
  body { padding-bottom: 0; }
}
.theme-toggle {
  margin-left: auto;
  background: var(--toggle-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  flex: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  box-shadow: 0 2px 8px var(--shadow-color);
  transition: transform .2s ease;
}
.theme-toggle:hover { transform: scale(1.08); }
.theme-toggle:active { transform: scale(0.95); }
:root .icon-sun { display: block; }
:root .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
@media (min-width: 900px) {
  .topnav { display: flex; }
  .topnav + .theme-toggle { margin-left: 0; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 40px 0 28px; }
.hero-grid { display: grid; gap: 8px; align-items: center; }
.eyebrow { margin: 0 0 6px; color: var(--accent-color); font-weight: 700; letter-spacing: .04em; }
.hero h1 { font-size: clamp(44px, 11vw, 88px); font-weight: 800; letter-spacing: -0.03em; }
.hero-sub { margin: 4px 0 18px; font-size: clamp(18px, 4.5vw, 24px); color: var(--text-secondary); font-weight: 600; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--bg-primary); border: 1px solid var(--border-color); font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.chip-strong { background: var(--accent-color); border-color: var(--accent-color); color: var(--on-accent); }
.countdown { margin: 22px 0 0; font-size: 18px; color: var(--text-secondary); }
.countdown strong { font-size: 40px; color: var(--accent-color); font-weight: 800; vertical-align: -4px; padding: 0 2px; }
.hero-art { position: relative; max-width: 420px; width: 100%; justify-self: center; }
.hero-art svg { width: 100%; height: auto; }
.hero-art .sun { fill: var(--sun); opacity: .9; }
.hero-art .hill-back { fill: var(--hill-back); }
.hero-art .hill-front { fill: var(--hill-front); }
.hero-art .fuji { fill: var(--fuji); }
.hero-art .snow { fill: var(--snow); }
.hero-art .lake { fill: var(--lake); opacity: .7; }
.route { list-style: none; display: flex; justify-content: center; gap: 0; padding: 0; margin: -6px 0 0; }
.route li { position: relative; display: flex; flex-direction: column; align-items: center; font-weight: 700; font-size: 13px; color: var(--text-secondary); padding: 0 12px; }
.route li .jp { font-size: 22px; color: var(--text-primary); line-height: 1.3; }
.route li + li::before { content: ''; position: absolute; left: -9px; top: 16px; width: 18px; border-top: 2px dashed var(--text-muted); }
.leaves span { position: absolute; top: -40px; font-size: 22px; opacity: .8; animation: fall linear infinite; }
.leaves span:nth-child(1) { left: 8%; animation-duration: 14s; animation-delay: -2s; }
.leaves span:nth-child(2) { left: 30%; animation-duration: 18s; animation-delay: -9s; font-size: 18px; }
.leaves span:nth-child(3) { left: 56%; animation-duration: 16s; animation-delay: -5s; }
.leaves span:nth-child(4) { left: 78%; animation-duration: 20s; animation-delay: -13s; font-size: 16px; }
.leaves span:nth-child(5) { left: 92%; animation-duration: 15s; animation-delay: -7s; }
@keyframes fall {
  0% { transform: translate3d(0, -40px, 0) rotate(0deg); }
  50% { transform: translate3d(-30px, 260px, 0) rotate(180deg); }
  100% { transform: translate3d(20px, 560px, 0) rotate(360deg); opacity: 0; }
}
@media (min-width: 820px) {
  .hero { padding: 64px 0 40px; }
  .hero-grid { grid-template-columns: 1.15fr 1fr; gap: 32px; }
}

/* ---------- Sub-page header ---------- */
.page { padding: 28px 0 48px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: clamp(30px, 7.5vw, 44px); font-weight: 800; letter-spacing: -0.02em; }
.lead { margin: 6px 0 0; color: var(--text-secondary); font-weight: 600; }
.muted { margin: -4px 0 12px; color: var(--text-muted); font-size: 14px; font-weight: 600; }
.block { margin-top: 32px; }
.block:first-of-type { margin-top: 0; }
.jumps { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 20px; padding: 2px 16px; }
.jumps::-webkit-scrollbar { display: none; }
.jump { flex: none; display: grid; justify-items: center; text-decoration: none; color: var(--text-secondary); font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 14px; background: var(--bg-primary); border: 1px solid var(--border-color); line-height: 1.3; }
.jump small { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.jump.active { border-color: var(--accent-color); color: var(--accent-color); }
.bullets { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.bullets.small { font-size: 14px; gap: 4px; color: var(--text-secondary); }
.notes-panel { margin-top: 24px; }
.notes-panel h2 { font-size: 20px; margin-bottom: 12px; }

/* ---------- Home ---------- */
.home-section { padding-top: 8px; }
.next-card { background: var(--bg-primary); border: 1px solid var(--border-color); border-left: 5px solid var(--accent-color); border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 6px 20px var(--shadow-color); display: grid; gap: 8px; justify-items: start; margin-bottom: 20px; }
.next-card h2 { font-size: 22px; }
.next-card p { margin: 0; color: var(--text-secondary); }
.next-kicker { font-size: 13px !important; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-color) !important; }
.next-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--text-secondary); }
.next-urgent { display: block; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-color); font-weight: 700; font-size: 14px; text-decoration: none; }
.nav-cards { display: grid; gap: 12px; }
@media (min-width: 720px) { .nav-cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .nav-cards { grid-template-columns: repeat(3, 1fr); } }
.nav-card { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; gap: 2px 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius); background: var(--bg-primary); border: 1px solid var(--border-color); text-decoration: none; color: var(--text-primary); transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease; }
.nav-card:hover { transform: translateY(-2px); border-color: var(--accent-color); box-shadow: 0 8px 22px var(--shadow-color); }
.nav-card-ic { grid-row: span 2; font-size: 30px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--bg-tertiary); }
.nav-card-body { display: grid; }
.nav-card-body strong { font-size: 17px; }
.nav-card-body span { font-size: 14px; color: var(--text-secondary); }
.nav-card-stat { font-size: 13px; font-weight: 700; color: var(--accent-color); }

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section.alt { background: color-mix(in srgb, var(--bg-tertiary) 45%, transparent); }
.section-head { margin-bottom: 22px; }
.kicker { margin: 0 0 6px; color: var(--accent-color); font-weight: 700; font-size: 14px; letter-spacing: .04em; }
.kicker .jp { margin-right: 6px; }
.section-head h2 { font-size: clamp(26px, 6vw, 38px); font-weight: 800; }
.sub { font-size: 18px; margin: 28px 0 12px; color: var(--text-secondary); }
.sub:first-of-type { margin-top: 0; }
.notice { margin: 0 0 20px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--gold-soft); color: var(--text-primary); border: 1px dashed var(--gold); font-size: 15px; }
.notice::before { content: '📝 '; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; font-size: 15px; border-radius: 999px; padding: 11px 20px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .15s ease, background-color .2s ease; min-height: 44px; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent-color); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .55; cursor: progress; }
.btn-ghost { background: transparent; border-color: var(--border-color); color: var(--text-primary); }
.btn-ghost:hover { background: var(--bg-tertiary); }
.btn-small { padding: 7px 14px; font-size: 14px; min-height: 36px; }
.btn-danger { color: var(--accent-color); }

/* ---------- Days ---------- */
.days { display: grid; gap: 16px; }
.day {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 2px var(--shadow-color);
}
.day.today { border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-soft), 0 8px 24px var(--shadow-color); }
.day-date { text-align: center; border-right: 1px dashed var(--border-color); padding-right: 14px; }
.day-num { display: block; font-size: 40px; font-weight: 800; line-height: 1; color: var(--accent-color); }
.day-month { display: block; font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-top: 4px; }
.day-wd { display: inline-block; margin-top: 8px; padding: 2px 8px; border-radius: 999px; background: var(--bg-tertiary); font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.day-label { margin: 0; font-size: 13px; font-weight: 700; color: var(--text-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.day-label .jp { color: var(--text-secondary); }
.day h2 { font-size: 20px; margin: 4px 0 10px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-today { background: var(--accent-color); color: var(--on-accent); }
.badge-suggest { background: var(--indigo-soft); color: var(--indigo); }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.items li { display: grid; grid-template-columns: 52px 24px 1fr; gap: 6px; align-items: start; }
.items .t { font-size: 12px; font-weight: 800; color: var(--accent-color); line-height: 1.6; padding-top: 2px; font-variant-numeric: tabular-nums; }
.items .ic { font-size: 18px; line-height: 1.5; text-align: center; }
.items .txt { min-width: 0; }
.items .note { display: block; font-size: 13px; color: var(--text-muted); }
.maplink { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; font-size: 12px; font-weight: 700; text-decoration: none; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-color); white-space: nowrap; }
.maplink:hover { background: var(--accent-color); color: var(--on-accent); }
.day-foot { margin-top: 12px; display: grid; gap: 8px; }
.stay { font-size: 14px; color: var(--text-secondary); }
.stay a { font-weight: 700; }
.tip { font-size: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--moss-soft); color: var(--text-primary); }
.tip::before { content: '💡 '; }
@media (max-width: 599px) {
  .day { grid-template-columns: 1fr; gap: 8px; padding: 16px; }
  .day-date { display: flex; align-items: baseline; gap: 8px; text-align: left; border-right: 0; padding: 0 0 8px; border-bottom: 1px dashed var(--border-color); }
  .day-num { font-size: 34px; }
  .day-month, .day-wd { margin-top: 0; }
}
@media (min-width: 720px) {
  .day { grid-template-columns: 96px 1fr; padding: 22px 24px; }
  .day-num { font-size: 48px; }
}

/* ---------- Flights, hotels, emergency ---------- */
.flights, .hotels, .emergency, .family, .tips { display: grid; gap: 14px; }
.card { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 18px; box-shadow: 0 1px 2px var(--shadow-color); }
.flight { display: grid; gap: 10px; }
.flight-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.flight-code { font-weight: 800; font-size: 18px; }
.flight-date { color: var(--text-muted); font-weight: 600; font-size: 14px; }
.flight-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.airport strong { display: block; font-size: 30px; font-weight: 800; letter-spacing: .02em; }
.airport span { font-size: 13px; color: var(--text-muted); }
.airport.to { text-align: right; }
.flight-line { position: relative; width: 56px; border-top: 2px dashed var(--text-muted); }
.flight-line::after { content: '✈'; position: absolute; left: 50%; top: -13px; transform: translateX(-50%); color: var(--accent-color); background: var(--bg-primary); padding: 0 4px; }
.status { font-size: 13px; font-weight: 600; color: var(--gold); }
.airport .ftime { display: block; font-size: 20px; font-weight: 800; color: var(--accent-color); }
.flight-note { font-size: 14px; color: var(--text-secondary); padding-top: 8px; border-top: 1px dashed var(--border-color); }
.stays { display: grid; gap: 14px; }
@media (min-width: 720px) { .stays { grid-template-columns: 1fr 1fr; } }
.stay-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px; }
.stay-head h3 { font-size: 18px; }
.badge-status { background: var(--gold-soft); color: var(--gold); }
.stay-kind { margin: 4px 0 10px; color: var(--text-muted); font-size: 14px; }
.stay-card dl { margin: 0 0 10px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.stay-card dt { color: var(--text-muted); }
.stay-card dd { margin: 0; font-weight: 600; }
.stations-title { margin: 12px 0 6px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.stations { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 14px; }
.stations li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--border-color); }
.stations li:last-child { border-bottom: 0; }
.stations b { color: var(--moss); font-variant-numeric: tabular-nums; }
.stay-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hotel h4 { margin: 0; font-size: 18px; }
.hotel .jp-name { margin: 2px 0 8px; color: var(--text-muted); font-size: 14px; }
.hotel dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.hotel dt { color: var(--text-muted); }
.hotel dd { margin: 0; }
.hotel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.em { display: grid; grid-template-columns: 36px 1fr; gap: 6px 12px; align-items: center; }
.em .em-call { grid-column: 2; justify-self: start; }
@media (min-width: 480px) {
  .em { grid-template-columns: 40px 1fr auto; }
  .em .em-call { grid-column: auto; justify-self: end; }
}
.em-icon { font-size: 26px; text-align: center; }
.em-label { font-weight: 700; font-size: 15px; }
.em-note { font-size: 13px; color: var(--text-muted); }
.em-call { font-weight: 800; text-decoration: none; padding: 8px 14px; border-radius: 999px; background: var(--accent-color); color: var(--on-accent); white-space: nowrap; }
.member { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.member strong { display: block; }
.member span { font-size: 13px; color: var(--text-muted); }
@media (min-width: 720px) {
  .flights, .hotels { grid-template-columns: 1fr 1fr; }
  .emergency, .family { grid-template-columns: 1fr 1fr; }
}

/* ---------- Tips, checklist, phrases ---------- */
.tips { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 24px; }
.tip-card { display: grid; grid-template-columns: 32px 1fr; gap: 2px 10px; align-items: start; padding: 14px 16px; }
.tip-card h3 { margin: 0; font-size: 16px; }
.tip-card p { grid-column: 2; margin: 0; font-size: 14px; color: var(--text-secondary); }
.tip-card .tip-ic { grid-row: span 2; font-size: 24px; line-height: 1.2; }
.two-col { display: grid; gap: 16px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }
.panel { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.panel-head h2, .panel-head h3 { font-size: 20px; }
.progress-text { font-size: 14px; font-weight: 700; color: var(--moss); }
.bar { height: 8px; border-radius: 999px; background: var(--bg-tertiary); overflow: hidden; margin-bottom: 14px; }
.bar span { display: block; height: 100%; width: 0; background: var(--moss); border-radius: inherit; transition: width .4s ease; }
.bar-big { height: 14px; }
.bar-big span { background: linear-gradient(90deg, var(--gold), var(--accent-color)); }
.check-group h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.check { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 8px; cursor: pointer; }
.check:hover { background: var(--bg-secondary); }
.check input { width: 20px; height: 20px; accent-color: var(--moss); flex: none; }
.check input:checked + span .check-text { color: var(--text-muted); text-decoration: line-through; }
.check { align-items: flex-start; }
.check input { margin-top: 3px; }
.check-text { display: block; }
.check-note { display: block; font-size: 13px; color: var(--text-muted); }
.check.urgent { background: var(--accent-soft); }
.badge-urgent { background: var(--accent-color); color: var(--on-accent); vertical-align: 1px; }
.pending { border-style: dashed; border-color: var(--gold); background: var(--gold-soft); }
.pending h3 { font-size: 20px; margin-bottom: 10px; }
.entry { display: grid; gap: 10px; }
@media (min-width: 720px) { .entry { grid-template-columns: 1fr 1fr; } }
.entry-item { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; padding: 14px 16px; }
.entry-item p { margin: 0; font-size: 15px; }
.entry-ic { font-size: 22px; line-height: 1.3; }
.entry-item.warn { border-color: var(--accent-color); background: var(--accent-soft); }
.entry-item.warn p { font-weight: 600; }
.hint { font-size: 13px; color: var(--text-muted); margin: 8px 0 0; }
#checkReset { margin-top: 12px; }
.phrases { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.phrase { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 6px; border-bottom: 1px dashed var(--border-color); }
.phrase:last-child { border-bottom: 0; }
.phrase .ja { font-family: var(--font-jp); font-size: 18px; font-weight: 700; }
.phrase .ro { font-size: 13px; color: var(--accent-color); font-weight: 600; }
.phrase .vi { font-size: 14px; color: var(--text-secondary); }
.speak { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-color); background: var(--bg-secondary); cursor: pointer; font-size: 16px; color: var(--text-primary); }
.speak:hover { background: var(--accent-soft); }

/* ---------- Leo corner ---------- */
.leo-progress { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.leo-score { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.leo-score strong { font-size: 40px; font-weight: 800; color: var(--accent-color); line-height: 1; }
.leo-score span { color: var(--text-muted); font-weight: 600; }
.leo-msg { margin: 0; font-weight: 600; color: var(--text-secondary); }
.missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mission {
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  font: inherit;
  padding: 16px 12px 14px;
  border-radius: var(--radius);
  background: var(--bg-primary);
  border: 2px dashed var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform .15s ease, border-color .2s ease;
}
.mission:hover { transform: translateY(-2px); border-color: var(--gold); }
.mission .m-emoji { font-size: 36px; line-height: 1.1; filter: grayscale(.85); opacity: .7; transition: filter .3s, opacity .3s, transform .3s; }
.mission .m-text { font-size: 14px; font-weight: 600; line-height: 1.35; }
.mission .m-when { font-size: 12px; color: var(--text-muted); }
.mission.done { border-style: solid; border-color: var(--gold); background: var(--gold-soft); }
.mission.done .m-emoji { filter: none; opacity: 1; transform: scale(1.12); }
.mission.done::after { content: '済'; position: absolute; top: 8px; right: 10px; font-family: var(--font-jp); font-weight: 700; font-size: 15px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--accent-color); color: var(--accent-color); transform: rotate(-12deg); }
.mission.pop { animation: pop .45s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
.lost-card { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-radius: var(--radius); background: var(--indigo-soft); border: 1px solid var(--border-color); }
.lost-card h2 { font-size: 18px; margin-bottom: 4px; }
.lost-card p { margin: 0; font-size: 14px; color: var(--text-secondary); max-width: 560px; }

/* ---------- Gallery ---------- */
.gallery-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; font: inherit; font-size: 14px; font-weight: 600; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-secondary); cursor: pointer; }
.filter[aria-selected="true"] { background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary); }
.filter small { opacity: .7; margin-left: 2px; }
.gallery { columns: 2 160px; column-gap: 10px; }
@media (min-width: 720px) { .gallery { columns: 3 220px; column-gap: 14px; } }
.ph { display: block; width: 100%; margin: 0 0 10px; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-tertiary); cursor: zoom-in; break-inside: avoid; position: relative; }
.ph img { width: 100%; height: auto; transition: transform .35s ease; }
.ph:hover img { transform: scale(1.03); }
.ph .ph-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font-size: 12px; font-weight: 600; text-align: left; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.day-sep { column-span: all; margin: 8px 0 12px; font-weight: 800; font-size: 15px; color: var(--text-secondary); }
.empty { column-span: all; text-align: center; padding: 40px 20px; border: 2px dashed var(--border-color); border-radius: var(--radius); color: var(--text-muted); background: var(--bg-primary); }
.empty .big { font-size: 44px; display: block; margin-bottom: 6px; }

/* ---------- Dialogs ---------- */
dialog { border: 0; padding: 0; color: var(--text-primary); }
dialog::backdrop { background: var(--overlay); }
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; background: transparent; }
.lb-inner { position: relative; width: 100%; height: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.lb-figure { margin: 0; display: grid; justify-items: center; gap: 10px; padding: 56px 8px 16px; max-height: 100dvh; }
.lb-figure img { max-width: 100%; max-height: calc(100dvh - 190px); object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-figure figcaption { text-align: center; color: #f3ece2; max-width: 680px; }
.lb-caption { margin: 0; font-weight: 700; }
.lb-meta { margin: 2px 0 8px; font-size: 13px; opacity: .75; }
.lb-actions { display: flex; gap: 8px; justify-content: center; }
.lb-actions .btn { color: #f3ece2; border-color: rgba(255,255,255,.3); }
.lb-actions .btn:hover { background: rgba(255,255,255,.12); }
.lb-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-primary); font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lb-close { position: absolute; top: 12px; right: 12px; z-index: 2; }
.lb-prev, .lb-next { margin: 0 8px; font-size: 30px; }
@media (max-width: 600px) { .lb-prev, .lb-next { position: absolute; bottom: 16px; z-index: 2; } .lb-prev { left: 8px; } .lb-next { right: 8px; } .lb-figure img { max-height: calc(100dvh - 230px); } }

.sheet { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border-radius: var(--radius); background: var(--bg-primary); box-shadow: 0 20px 60px var(--shadow-strong); }
.sheet-inner { padding: 20px; display: grid; gap: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: 20px; }
.drop { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; padding: 22px 16px; border-radius: var(--radius-sm); border: 2px dashed var(--border-color); background: var(--bg-secondary); cursor: pointer; }
.drop.over { border-color: var(--accent-color); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon { font-size: 30px; }
.drop-hint { font-size: 13px; color: var(--text-muted); }
.up-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.up-previews:empty { display: none; }
.up-prev { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg-tertiary); }
.up-prev img { width: 100%; height: 100%; object-fit: cover; }
.up-prev .st { position: absolute; inset: auto 0 0 0; font-size: 11px; font-weight: 700; text-align: center; padding: 2px; background: rgba(0,0,0,.55); color: #fff; }
.up-prev.ok .st { background: rgba(60,120,50,.85); }
.up-prev.err .st { background: rgba(180,40,30,.9); }
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.field input, .field select { font: inherit; font-size: 16px; font-weight: 500; color: var(--text-primary); background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px; }
.field input:focus, .field select:focus { outline: 2px solid var(--accent-color); outline-offset: 0; }
.up-status { margin: 0; min-height: 1.4em; font-size: 14px; font-weight: 600; }
.up-status.error { color: var(--accent-color); }
.up-status.ok { color: var(--moss); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; }

.bigcard { width: min(640px, calc(100vw - 20px)); border-radius: var(--radius); background: var(--bg-primary); box-shadow: 0 20px 60px var(--shadow-strong); }
.bigcard-inner { position: relative; padding: 28px 22px 24px; }
.bigcard-close { position: absolute; top: 12px; right: 12px; }
.big-ja { font-family: var(--font-jp); font-size: clamp(26px, 7vw, 40px); font-weight: 700; line-height: 1.45; margin: 8px 0 14px; }
.big-label { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.big-vi { font-size: 15px; color: var(--text-secondary); margin: 0 0 14px; }
.big-phone { display: block; font-size: clamp(26px, 7vw, 36px); font-weight: 800; color: var(--accent-color); text-decoration: none; margin: 2px 0; }
.big-box { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg-secondary); margin-top: 12px; }

/* ---------- Footer ---------- */
.footer { padding: 32px 0 48px; text-align: center; color: var(--text-muted); font-size: 14px; border-top: 1px solid var(--border-color); }
.footer .jp { color: var(--accent-color); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .leaves { display: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 64px 0; display: grid; justify-items: center; gap: 12px; }
.notfound .big { font-size: 64px; }
.notfound h1 { font-size: 30px; }
.notfound p { margin: 0; color: var(--text-secondary); }
