/* MikuPass shared palette, typography, panels, fields and buttons. */
:root {
  --canvas: oklch(97.5% .004 255);
  --surface: #fff;
  --surface-2: oklch(95.7% .006 255);
  --ink: oklch(22% .018 255);
  --muted: oklch(48% .018 255);
  --line: oklch(89% .008 255);
  --accent: oklch(56% .18 255);
  --accent-strong: oklch(49% .19 255);
  --accent-soft: oklch(94% .035 255);
  --danger: oklch(54% .18 25);
  --focus: oklch(68% .17 250);
  --tokyo: #39c5bb;
  --osaka: #ff6fb5;
  --hamamatsu: #f2c94c;
  --primary: var(--accent);
  --teal-ink: #126961;
  --stripe: #ffffffb8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.page-scroll { overflow-y: auto; scroll-padding-block: 12px; }
.wrap { max-width: 880px; margin: auto; padding: 28px 24px 12px; }
.dashboard { max-width: 990px; }
header { margin-bottom: 20px; }
header small { color: var(--teal-ink); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
h1 { margin: 3px 0 6px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.035em; line-height: 1.25; }
h2 { margin: 0; font-size: 16px; }
p { margin: 8px 0 0; }
p, small, .hint { color: var(--muted); }
.hint { font-size: 12px; }
a { color: var(--accent-strong); }
button, input, select { font: inherit; color: inherit; }
button, .gate-actions a {
  display: inline-flex; justify-content: center; align-items: center;
  min-height: 44px; padding: 0 16px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); font-weight: 700; cursor: pointer;
}
.gate-actions a { text-decoration: none; color: var(--ink); }
button.primary, #login button, .gate-actions a:first-child { color: white; border-color: var(--primary); background: var(--primary); }
button.danger { color: var(--danger); }
button:disabled { opacity: .55; cursor: default; }
@media (hover: hover) {
  button:not(:disabled):hover, .gate-actions a:hover { border-color: var(--accent); }
  button.primary:hover, #login button:hover, .gate-actions a:first-child:hover { background: var(--accent-strong); }
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.panel { margin-top: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.grid, .checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid > div { min-width: 0; }
label { display: block; margin: 14px 0 5px; font-size: 13px; font-weight: 700; }
input:not([type=checkbox]), select {
  width: 100%; min-height: 44px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 16px;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus { border-color: var(--accent); }
.row, .tags, .gate-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.between { justify-content: space-between; }
.tabs, .ticket-options { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.tabs { margin: 15px 0; }
.tab { gap: 6px; }
.tab span { min-width: 20px; padding: 0 5px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.tabs button, .ticket-options button { min-height: 44px; border: 0; background: transparent; color: var(--muted); }
.tabs button { flex: 1; padding: 0 14px; }
.ticket-options { display: grid; grid-template-columns: repeat(2, minmax(3.5em, max-content)); flex: none; }
.ticket-options button { padding: 0 .55em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ticket-options button[aria-pressed=true] { background: var(--primary); color: #fff; }
.tabs button.active {
  color: var(--accent-strong); background: var(--surface); box-shadow: 0 1px 4px #17233a18;
}
.account, .result-card { min-width: 0; padding: 16px; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; }
.account { scroll-margin-top: 12px; }
.receipt-actions { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.receipt-actions #copy { margin: 0; }
.receipt-actions a { padding: 10px 0; font-weight: 700; }
.account > .row { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.account > .row:only-child { padding: 0; border: 0; }
.account strong { overflow-wrap: anywhere; }
.account .rename { padding: 0 9px; min-height: 32px; margin: 0 4px; vertical-align: middle; }
.account .row p { font-size: 12px; }
.tag, .wonTag { display: inline-flex; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--accent-soft); color: var(--accent-strong); }
.wonTag { background: color-mix(in oklch, var(--tokyo) 18%, var(--surface)); color: var(--teal-ink); }
.checks { gap: 8px; margin-top: 10px; }
.session-choice, .checks label {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 0;
  border: 1px solid var(--line); border-radius: 9px; font-weight: 650;
}
.session-choice { justify-content: space-between; }
.session-choice:has([aria-pressed=true]), .checks label:has(:checked) { border-color: var(--accent); }
.checks label { min-height: 44px; cursor: pointer; }
.checks input { width: 18px; height: 18px; accent-color: var(--primary); }
#add { width: 100%; margin: 14px 0 2px; }
.visibility-setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.visibility-setting input {
  appearance: none; width: 44px; height: 26px; margin: 0; padding: 3px;
  border-radius: 20px; background: var(--muted); cursor: pointer;
}
.visibility-setting input::before { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: white; }
.visibility-setting input:checked { background: var(--primary); }
.visibility-setting input:checked::before { transform: translateX(18px); }
.actions, #copy, #signed, .gate-actions, #owned button { margin-top: 12px; }
#login { scroll-margin-top: 24px; }
#private-link { margin-top: 10px; }
.status { white-space: pre-line; }
p:empty { display: none; }

/* The ticket overview's four metric cards and striped color bands. */
.dashboard .panel { border-radius: 16px; box-shadow: 0 8px 24px #17233a0a; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.metric {
  --metric: var(--tokyo); position: relative; display: grid; align-content: center; gap: 4px; min-width: 0; min-height: 112px;
  padding: 14px; overflow: hidden; border: 1px solid color-mix(in oklch, var(--metric) 28%, var(--line));
  border-radius: 12px; background: color-mix(in oklch, var(--metric) 8%, var(--surface));
}
.metric:nth-child(2) { --metric: var(--osaka); }
.metric:nth-child(3) { --metric: var(--accent); }
.metric:nth-child(4) { --metric: var(--hamamatsu); }
.metric::after {
  position: absolute; inset: 0 0 0 62%; content: "";
  background: repeating-linear-gradient(135deg, transparent 0 7px, var(--stripe) 7px 10px), color-mix(in oklch, var(--metric) 16%, var(--surface));
}
.metric > * { position: relative; z-index: 1; }
.metric span { font-size: 13px; font-weight: 700; }
.metric strong { font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; color: color-mix(in oklch, var(--metric) 53%, var(--ink)); }
.board-section-head, .legend { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.legend { color: var(--muted); font-size: 12px; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 4px; border-radius: 3px; background: var(--accent); }
.legend span + span::before { background: var(--tokyo); }
#breakdown { margin-top: 14px; }
.session-line { display: grid; grid-template-columns: 68px minmax(20px, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.session-line small { font-variant-numeric: tabular-nums; }
.bar-pair { display: grid; gap: 4px; }
.bar-track, .bar-track i { height: 6px; border-radius: 4px; }
.bar-track { background: var(--surface-2); }
.bar-track i { display: block; background: var(--accent); }
.bar-track + .bar-track i { background: var(--tokyo); }
#cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
.result-card h3 { margin: 0; overflow-wrap: anywhere; }
.result-card h4 { margin: 10px 0 5px; font-size: 12px; color: var(--muted); }
#next-page, #retry { margin-top: 10px; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; padding: 24px 0; color: var(--muted); font-size: 12px; }
.site-footer a { color: var(--accent); font-weight: 700; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* MikuPass floating navigation: horizontal on desktop, stacked icons on mobile. */
.bottom-nav {
  justify-self: center; align-self: center; margin: 6px 0 max(10px, env(safe-area-inset-bottom));
  display: flex; gap: 5px; padding: 8px; border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in oklch, var(--surface) 87%, transparent);
  box-shadow: inset 0 1px 0 #ffffffb8, 0 8px 26px #17233a1a;
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.bottom-nav a { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 16px; border-radius: 999px; color: var(--muted); font-weight: 750; text-decoration: none; }
.bottom-nav a[aria-current=page] { color: var(--accent-strong); background: var(--accent-soft); }
.bottom-nav svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 900px) {
  .bottom-nav { width: min(280px, calc(100% - 24px)); padding: 6px; }
  .bottom-nav a { flex: 1; flex-direction: column; gap: 2px; min-height: 52px; font-size: 12px; }
  .bottom-nav svg { width: 22px; height: 22px; }
}
@media (max-width: 640px) {
  .wrap { padding: 20px 12px 8px; }
  header { margin-bottom: 14px; }
  .panel { padding: 15px; }
  .grid, .checks, #cards { grid-template-columns: 1fr; }
  .account { padding: 12px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .session-line { gap: 6px; grid-template-columns: 60px minmax(12px, 1fr) auto; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .bottom-nav { width: auto; padding: 3px; margin-block: 3px max(3px, env(safe-area-inset-bottom)); }
  .bottom-nav a { flex-direction: row; gap: 8px; min-height: 44px; padding: 0 16px; }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark; --canvas: #10151e; --surface: #192230; --surface-2: #222e3f;
    --ink: #edf2fa; --muted: #afbed2; --line: #40516a; --accent: #91b8ff;
    --accent-strong: #b4ceff; --accent-soft: #253b5d; --danger: #ffacb4; --focus: #b4ceff;
    --primary: #315fae; --teal-ink: #75dfd2; --stripe: #ffffff0a;
  }
  button.primary:hover, #login button:hover, .gate-actions a:first-child:hover { background: #3d6cba; }
}
@media (prefers-reduced-transparency: reduce) {
  .bottom-nav { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); }
}

.draft-notice, .results-feedback { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.draft-notice { margin: 12px 0; padding: 4px 12px; border-radius: 8px; background: var(--accent-soft); }
.draft-notice button, .results-feedback button { border-color: transparent; color: var(--accent-strong); background: transparent; }
.field-error { color: var(--danger); font-weight: 650; font-size: 13px; }
[aria-invalid=true] { border-color: var(--danger) !important; }
.travel summary { font-size:16px; font-weight:700; cursor:pointer; padding-block:6px; }
.cost-line { display:grid; grid-template-columns:minmax(52px,1fr) minmax(105px,1.4fr) minmax(65px,1fr); align-items:center; gap:10px; padding:14px 0; border-bottom:1px solid var(--line); }
.cost-line small { display:block; margin-top:4px; }
.cost-line label { margin:0 0 3px; }
.cost-line > strong { text-align:right; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.budget-total,.price-receipt { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding:12px 0; }
.budget-total strong { font-size:24px; color:var(--accent-strong); }
.price-receipt { border-top:1px solid var(--line); }
#copy-fallback { width:100%; min-height:140px; }
.bottom-nav a { white-space:nowrap; }
.city-picker { min-width:0; margin:12px 0 0; padding:10px 12px; border:1px solid var(--line); border-radius:10px; }
.city-picker legend { padding-inline:4px; font-weight:750; }
.city-picker label { margin-top:5px; }
.city-picker small { display:block; }
.expense-fields { margin-top:14px; display:grid; gap:10px; grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); }
.expense-entry { padding:10px 12px; border:1px solid var(--line); border-radius:10px; }
.expense-entry label { margin-top:4px; }
.travel-jump { margin-top:12px; }
.travel-jump a { display:inline-flex; align-items:center; min-height:44px; padding:0 12px; background:var(--accent-soft); border-radius:8px; font-weight:650; }
#share-section { scroll-margin-block:8px; }

.travel-entry {display:inline-flex;align-items:center;min-height:44px;margin-top:4px;font-weight:650;}
