:root {
  --main: #ff6d00;
  --main-soft: rgba(255, 109, 0, 0.14);
  --on-main: #fff;
  --bg: #f4f2f7;
  --card: rgba(255, 255, 255, 0.94);
  --card-solid: #fff;
  --fg: #1d1b20;
  --muted: #6b6870;
  --line: #e6e2ea;
  --hover: rgba(0, 0, 0, 0.05);
  --danger: #d32f2f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --rail: 80px;      /* the tabs on the left (big screens) */
  --panel: 400px;    /* a panel beside the rail */
  --tabs: 64px;      /* the tabs at the bottom (phones) */
  --pl: 0px;         /* the part of the map a panel covers on the left */
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214; --card: rgba(32, 31, 36, 0.92); --card-solid: #202024; --fg: #ecebf0; --muted: #a8a5ad;
    --line: #34323a; --hover: rgba(255, 255, 255, 0.07); --main-soft: rgba(255, 109, 0, 0.22);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 20px rgba(0, 0, 0, 0.45);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }

/* The phone's icons: Material Symbols Rounded (Apache 2.0), only the icons this page uses, served
   from here (no outside font service). Adding an icon: fetch the font again with its name in
   icon_names (see symbols.woff2 in README). */
@font-face { font-family: "Nuri Symbols"; font-style: normal; font-weight: 500; font-display: block; src: url(/web/symbols.woff2) format("woff2"); }
.ms { font-family: "Nuri Symbols"; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; overflow: hidden; width: 1em; flex: none; user-select: none; }

button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card-solid); color: var(--fg); border-radius: 999px; padding: 7px 14px; transition: background-color .15s, color .15s, border-color .15s, transform .1s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover { background: var(--hover); }
button:active { transform: scale(0.97); }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }
button.primary { background: var(--main); color: var(--on-main); border-color: var(--main); font-weight: 700; }
button.primary:hover { filter: brightness(1.06); background: var(--main); }
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: transparent; }
button.icon { width: 40px; height: 40px; padding: 0; border: none; background: transparent; border-radius: 12px; color: var(--fg); flex: none; }
button.icon:hover { background: var(--hover); }
button.icon.on { color: var(--main); background: var(--main-soft); }
button.round { width: 48px; height: 48px; padding: 0; border-radius: 50%; border: none; background: var(--card); box-shadow: var(--shadow); color: var(--fg); position: relative; flex: none; backdrop-filter: blur(12px); }
button.round:hover { background: var(--card-solid); }
button.round.on, button.round[aria-expanded="true"] { background: var(--main); color: var(--on-main); }
button.link { border: none; background: transparent; color: var(--main); padding: 2px 0; font-weight: 700; font-size: 0.9em; align-self: flex-start; }
button.link:hover { background: transparent; text-decoration: underline; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-solid); color: var(--fg); }
textarea { resize: vertical; }
kbd { font: 700 0.85em ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--card-solid); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.message { min-height: 1.4em; font-size: 0.9em; margin: 0; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 0.85em; line-height: 1.6; margin: 0; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }

/* --- sign-in --- */
.signin { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 20% 10%, rgba(255, 109, 0, 0.25), transparent 60%), radial-gradient(900px 500px at 90% 90%, rgba(176, 77, 255, 0.18), transparent 60%), var(--bg); }
.signin-card { width: min(420px, 100%); background: var(--card-solid); border-radius: 24px; box-shadow: var(--shadow); padding: 36px 28px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.signin-card h1 { margin: 0; font-size: 1.4em; }
.signin-card p { margin: 0 0 8px; color: var(--muted); line-height: 1.7; }
.logo { width: 72px; height: 72px; border-radius: 22px; background: linear-gradient(135deg, #ff9800, #ff4081); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 22px; letter-spacing: -0.5px; box-shadow: 0 6px 18px rgba(255, 109, 0, 0.35); }
.logo sup, .brand sup { font-size: 0.6em; align-self: flex-start; margin-top: 0.35em; }

/* --- the frame: the tabs on the left (at the bottom on phones), the map filling the rest --- */
.app { position: fixed; inset: 0; overflow: hidden; }
nav.rail { position: absolute; z-index: 6; left: 0; top: 0; bottom: 0; width: var(--rail); background: var(--card-solid); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; }
.brand { font-weight: 900; color: #fff; background: linear-gradient(135deg, #ff9800, #ff4081); border-radius: 14px; width: 52px; height: 44px; display: flex; align-items: center; justify-content: center; letter-spacing: -0.5px; font-size: 15px; margin-bottom: 10px; }
.tab { flex-direction: column; gap: 3px; width: 68px; padding: 6px 0 7px; border: none; background: transparent; border-radius: 16px; font-size: 12px; font-weight: 700; color: var(--muted); }
.tab .ms { width: 56px; height: 30px; display: grid; place-items: center; border-radius: 15px; font-size: 24px; transition: background-color .15s; }
.tab:hover { background: transparent; color: var(--fg); }
.tab:hover .ms { background: var(--hover); }
.tab[aria-current="page"] { color: var(--main); }
.tab[aria-current="page"] .ms { background: var(--main); color: var(--on-main); }
.avatar { margin-top: auto; width: 40px; height: 40px; padding: 0; border: none; background: linear-gradient(135deg, #2e9bff, #b04dff); color: #fff; font-weight: 800; }
.avatar:hover { background: linear-gradient(135deg, #2e9bff, #b04dff); filter: brightness(1.1); }

.stage { position: absolute; left: var(--rail); top: 0; right: 0; bottom: 0; }
.map { position: absolute; inset: 0; background: #1b1d22; }
.map-pane { position: absolute; inset: 0; overflow: hidden; }
.map canvas { width: 100%; height: 100%; display: block; touch-action: none; }
/* A panel covers the left of the map: what floats over the map moves beside it. */
.app:has(.panel:not([hidden])) { --pl: calc(var(--panel) + 12px); }

/* --- over the map --- */
.over-top { position: absolute; z-index: 3; top: 12px; left: calc(12px + var(--pl)); right: 12px; display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; pointer-events: none; transition: left .2s; }
.over-top > * { pointer-events: auto; }
.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.summary { padding: 10px 16px 11px; min-width: 190px; }
.sum-main { display: flex; align-items: baseline; gap: 4px; }
.sum-main b { font-size: 2.1em; font-weight: 800; letter-spacing: -0.5px; color: var(--main); font-variant-numeric: tabular-nums; line-height: 1.1; }
.sum-main span { font-weight: 800; }
.sum-sub { font-size: 0.85em; color: var(--muted); font-weight: 600; }
.sum-new { font-size: 0.82em; font-weight: 700; color: #00b8d4; margin-top: 2px; }
.sum-new:empty { display: none; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; max-width: 560px; }
.chip { background: var(--card); border: none; box-shadow: var(--shadow); padding: 6px 12px 6px 9px; font-size: 0.88em; font-weight: 700; backdrop-filter: blur(12px); }
.chip .ms { font-size: 18px; }
.chip:hover { background: var(--card-solid); }
.chip.active { background: var(--main); color: var(--on-main); }
#pending-chip { background: #fff3e0; color: #e65100; }
@media (prefers-color-scheme: dark) { #pending-chip { background: #4a2a10; color: #ffb74d; } }
.legend { cursor: default; padding: 6px 12px; font-size: 0.8em; display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.legend i.faint { background: color-mix(in srgb, var(--main) 30%, transparent); }
.tools { position: relative; display: flex; flex-direction: column; gap: 10px; }
.tools .badge { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; padding: 0; border-radius: 50%; background: #00e5ff; border: 2px solid var(--card-solid); }
.menu { position: absolute; right: 58px; top: 0; padding: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 170px; z-index: 2; }
.menu button { justify-content: flex-start; border: none; background: transparent; border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.menu button:hover { background: var(--hover); }
.menu button[aria-pressed="true"] { color: var(--main); background: var(--main-soft); }

.controls { position: absolute; z-index: 2; right: 12px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.zoom { display: flex; flex-direction: column; padding: 4px; }
.zoom button + button { border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }

.periods { position: absolute; z-index: 2; bottom: 20px; left: calc(var(--pl) + (100% - var(--pl)) / 2); transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; border-radius: 999px; max-width: calc(100% - var(--pl) - 140px); overflow-x: auto; scrollbar-width: none; transition: left .2s; }
.periods button { border: none; background: transparent; border-radius: 999px; padding: 7px 14px; white-space: nowrap; color: var(--muted); font-weight: 700; }
.periods button:hover { color: var(--fg); background: var(--hover); }
.periods button.on { background: var(--main); color: var(--on-main); }
.periods button.icon { width: 36px; height: 34px; border-radius: 999px; }

/* --- panels: beside the rail; a sheet over the tabs on phones --- */
.panel { position: absolute; z-index: 5; top: 12px; left: calc(var(--rail) + 12px); bottom: 12px; width: min(var(--panel), calc(100% - var(--rail) - 24px)); background: var(--card-solid); border-radius: 20px; box-shadow: var(--shadow); padding: 14px 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; animation: slide-in .2s ease-out; overscroll-behavior: contain; }
/* A tall panel scrolls: its parts keep their height instead of being squeezed over each other. */
.panel > * { flex-shrink: 0; }
@keyframes slide-in { from { opacity: 0; transform: translateX(-16px); } }
@keyframes slide-up { from { opacity: 0; transform: translateY(24px); } }
.panel-head { display: flex; align-items: center; gap: 4px; position: sticky; top: -14px; background: var(--card-solid); margin: -14px -18px 0; padding: 12px 10px 8px 18px; z-index: 2; }
.panel-head h2 { margin: 0; font-size: 1.15em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-head .close { margin-left: auto; }
.panel h3 { margin: 8px 0 0; font-size: 0.95em; }
.panel label { display: flex; flex-direction: column; gap: 5px; font-size: 0.85em; color: var(--muted); font-weight: 600; }
.panel .label { font-size: 0.85em; color: var(--muted); font-weight: 600; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 4px; }
.actions .primary { flex: 1; }

@media (max-width: 640px) {
  :root { --rail: 0px; }
  .app:has(.panel:not([hidden])) { --pl: 0px; }
  nav.rail { top: auto; right: 0; width: auto; height: calc(var(--tabs) + env(safe-area-inset-bottom)); flex-direction: row; justify-content: space-around; padding: 4px 4px env(safe-area-inset-bottom); border-right: none; border-top: 1px solid var(--line); gap: 0; }
  .brand, .avatar { display: none; }
  .tab { flex: 1; width: auto; }
  .stage { bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); }
  .over-top { left: 10px; right: 10px; top: 10px; }
  .summary { min-width: 0; padding: 8px 14px 9px; }
  .sum-main b { font-size: 1.7em; }
  .chips-row { max-width: calc(100vw - 80px); }
  .controls { bottom: 72px; right: 10px; }
  .periods { bottom: 12px; left: 10px; right: 10px; transform: none; max-width: none; justify-content: space-between; }
  .periods button { padding: 7px 8px; flex: 1; }
  .panel { top: auto; left: 0; right: 0; bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); width: 100%; max-height: 72%; border-radius: 22px 22px 0 0; animation-name: slide-up; }
  .panel::before { content: ""; align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line); flex: none; margin: -4px 0 2px; }
  /* The sheet covers the bottom of the map: what sits there makes way. */
  .app:has(.panel:not([hidden])) .periods, .app:has(.panel:not([hidden])) .controls { display: none; }
}

/* --- the pins: drawn as HTML over the map (map.js MarkerLayer), like the phone's --- */
.markers { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 1; }
.mk { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; will-change: transform; }
.mk:hover { z-index: 3; }
.mk .name { position: absolute; top: 3px; left: 0; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 800; color: #1d1b20; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.86); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); display: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.mk .name:empty { display: none !important; }
.markers.names .mk .name, .mk:hover .name, .mk.big .name { display: block; }
/* A teardrop in the place's colour, the icon (or the day's stop number) in white; its tip on the spot. */
.mk.pin .head { position: absolute; left: -18px; top: -44px; width: 36px; height: 36px; display: grid; place-items: center; color: #fff; transform: scale(var(--k, 1)); transform-origin: 18px 44px; transition: transform .12s; }
.mk.pin .head::before { content: ""; position: absolute; inset: 0; background: var(--c); border: 2.5px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: -1px 2px 5px rgba(0, 0, 0, 0.35); z-index: -1; }
.mk.pin .head .ms { font-size: 20px; }
.mk.pin .head b { font-size: 15px; font-weight: 900; }
.mk.pin:hover .head { transform: scale(calc(var(--k, 1) * 1.12)); }
.mk.pin.faint { opacity: 0.4; }
.mk.pin.big { z-index: 2; }
.mk.pin.draft .head::before { background: var(--main); border-style: dashed; }
/* A round photo with a white rim and a small tail; +N when photos gather. */
.mk.photo img, .mk.photo.broken::after { position: absolute; left: -25px; top: -60px; width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); background: #ccc; }
.mk.photo.broken::after { content: ""; background: #9e9e9e; }
.mk.photo::before { content: ""; position: absolute; left: -7px; top: -12px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 11px solid #fff; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.3)); }
.mk.photo .more { position: absolute; left: 12px; top: -66px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--main); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; border: 2px solid #fff; z-index: 1; }
.mk.photo .more:empty { display: none; }
.mk.photo:hover img { transform: scale(1.08); }
.mk.photo img { transition: transform .12s; transform-origin: 25px 60px; }
/* どこにいた？: a grey dashed ring with a question mark. */
.mk.ring { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
.mk.ring::before { content: "?"; position: absolute; inset: 0; border-radius: 50%; border: 3px dashed #fff; background: rgba(120, 120, 120, 0.75); color: #fff; font-weight: 900; font-size: 15px; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }
/* You (blue) and the replay's brush: a dot; moving, a disc with the way's icon and an arrow. */
.mk.dot { z-index: 4; pointer-events: none; }
.mk.dot .disc { position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 7px color-mix(in srgb, var(--c) 22%, transparent), 0 1px 4px rgba(0, 0, 0, 0.4); }
.mk.dot.moving .disc { left: -18px; top: -18px; width: 36px; height: 36px; display: grid; place-items: center; color: #fff; }
.mk.dot.moving .disc .ms { font-size: 21px; }
.mk.dot .arrow { position: absolute; left: -27px; top: -27px; width: 54px; height: 54px; }
.mk.dot .arrow::before { content: ""; position: absolute; left: 50%; top: -5px; transform: translateX(-50%); border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 12px solid var(--c); filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); }

/* --- 地図の見え方 --- */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.preset { flex-direction: column; align-items: flex-start; gap: 2px; border-radius: 16px; padding: 12px; text-align: left; background: transparent; min-height: 92px; justify-content: flex-start; }
.preset .ms { font-size: 26px; color: var(--main); margin-bottom: 4px; }
.preset b { font-size: 0.95em; }
.preset small { color: var(--muted); font-size: 0.75em; line-height: 1.3; }
.preset[aria-pressed="true"] { background: var(--main); border-color: var(--main); color: var(--on-main); }
.preset[aria-pressed="true"] .ms, .preset[aria-pressed="true"] small { color: var(--on-main); }
.map-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.map-types button { border-radius: 14px; padding: 6px 4px 8px; flex-direction: column; gap: 6px; font-size: 0.8em; font-weight: 600; background: transparent; }
.map-types button i { width: 100%; aspect-ratio: 1.25; border-radius: 10px; display: block; }
.map-types button[aria-pressed="true"] { border-color: var(--main); background: var(--main-soft); color: var(--main); }
.t-normal { background: linear-gradient(115deg, transparent 46%, #fff 46% 54%, transparent 54%), linear-gradient(20deg, transparent 60%, #ffd54f 60% 66%, transparent 66%), #e8eaed; border: 1px solid var(--line); }
.t-satellite { background: radial-gradient(circle at 30% 35%, #4e7a3c 0 22%, transparent 23%), radial-gradient(circle at 70% 70%, #6b5b3e 0 25%, transparent 26%), linear-gradient(135deg, #2f4a2a, #4b6b45); }
.t-hybrid { background: linear-gradient(115deg, transparent 46%, rgba(255, 255, 255, 0.85) 46% 52%, transparent 52%), radial-gradient(circle at 30% 35%, #4e7a3c 0 22%, transparent 23%), linear-gradient(135deg, #2f4a2a, #4b6b45); }
.t-paint { background: linear-gradient(115deg, transparent 45%, #ff6d00 45% 52%, transparent 52%), linear-gradient(25deg, transparent 62%, rgba(255, 109, 0, 0.7) 62% 67%, transparent 67%), #1b1d22; }
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle { border-radius: 14px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; text-align: left; background: transparent; justify-content: stretch; }
.toggle .ms { grid-row: span 2; font-size: 24px; }
.toggle small { color: var(--muted); font-size: 0.78em; }
.toggle[aria-pressed="true"] { background: var(--main-soft); border-color: var(--main); }
.toggle[aria-pressed="true"] b, .toggle[aria-pressed="true"] .ms { color: var(--main); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 6px 12px; font-size: 0.92em; background: transparent; }
.chips button .ms { font-size: 18px; }
.chips button[aria-pressed="true"] { background: var(--main); color: var(--on-main); border-color: var(--main); }
.small-chips button { padding: 4px 10px; font-size: 0.85em; }
.segment { display: flex; gap: 2px; background: var(--hover); border-radius: 12px; padding: 3px; flex-wrap: wrap; }
.segment button { flex: 1; border: none; background: transparent; border-radius: 9px; padding: 7px 8px; font-weight: 700; color: var(--muted); font-size: 0.9em; white-space: nowrap; }
.segment button .ms { font-size: 18px; }
.segment button[aria-pressed="true"] { background: var(--card-solid); color: var(--main); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }

/* --- その他 --- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { flex-direction: column; align-items: flex-start; gap: 2px; border-radius: 16px; padding: 14px; text-align: left; background: transparent; }
.tile .ms { font-size: 28px; color: var(--main); margin-bottom: 4px; }
.tile small { color: var(--muted); font-size: 0.78em; }
.keys { line-height: 2.1; }

/* --- カレンダー --- */
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-head { color: var(--muted); font-size: 0.8em; font-weight: 700; }
.cal-head span:nth-child(6) { color: #2e9bff; }
.cal-head span:nth-child(7) { color: #ff4f8b; }
.cal-grid button { border-radius: 12px; padding: 5px 0 4px; min-height: 52px; flex-direction: column; justify-content: flex-start; gap: 1px; font-size: 0.9em; font-weight: 600; border-color: transparent; background: color-mix(in srgb, var(--main) calc(var(--heat, 0) * 70%), transparent); }
.cal-grid button:hover { border-color: var(--main); }
.cal-grid button small { font-size: 0.72em; font-weight: 800; }
.cal-grid button.today { border-color: var(--main); border-width: 2px; }
.cal-grid button.on { outline: 3px solid var(--main); outline-offset: 1px; }
.cal-grid button:disabled { visibility: hidden; }
.cal-grid button.future { visibility: visible; opacity: 0.35; }
.cal-total { margin: 4px 0 0; font-weight: 700; }

/* --- 場所の一覧 --- */
.search { position: relative; flex-direction: row !important; align-items: center; }
.search .ms { position: absolute; left: 11px; color: var(--muted); font-size: 20px; }
.search input { padding-left: 38px; border-radius: 999px; background: var(--hover); border-color: transparent; }
.list-sort { display: flex; align-items: center; gap: 8px; }
.list-sort select { width: auto; padding: 5px 10px; border-radius: 999px; font-size: 0.88em; }
.places { list-style: none; margin: 0 -8px; padding: 0; }
.places li button { width: 100%; text-align: left; border: none; border-radius: 12px; padding: 8px; justify-content: flex-start; gap: 12px; background: transparent; }
.places li button:hover { background: var(--hover); }
.pin-badge { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c, var(--main)); flex: none; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.pin-badge .ms { font-size: 20px; }
.place-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.place-text b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-text small { color: var(--muted); font-size: 0.8em; }
.places img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--card-solid); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }

/* --- 場所 --- */
.sheet-hero { display: flex; gap: 12px; align-items: center; }
.sheet-hero .pin-badge { width: 48px; height: 48px; }
.sheet-hero .pin-badge .ms { font-size: 26px; }
.visits { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.88em; }
.visits span { background: var(--hover); border-radius: 999px; padding: 4px 10px; font-weight: 600; }
.visits span.strong { background: var(--main-soft); color: var(--main); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.photos:empty { display: none; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; cursor: zoom-in; background: var(--line); transition: transform .15s; }
.photos img:hover { transform: scale(1.03); }
.photos img:first-child:not(:only-child) { grid-column: span 2; grid-row: span 2; }
.drop { flex-direction: row !important; align-items: center; justify-content: center; gap: 8px !important; border: 2px dashed var(--line); border-radius: 14px; padding: 12px; cursor: pointer; color: var(--muted); transition: border-color .15s, background-color .15s; }
.drop:hover, .drop.over { border-color: var(--main); background: var(--main-soft); color: var(--main); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.icon-grid button { height: 44px; padding: 0; border-radius: 12px; background: transparent; border-color: transparent; flex-direction: column; gap: 0; font-size: 9px; color: var(--muted); }
.icon-grid button .ms { font-size: 22px; color: var(--fg); }
.icon-grid button:hover { border-color: var(--line); }
.icon-grid button[aria-checked="true"] { background: var(--main); border-color: var(--main); color: var(--on-main); }
.icon-grid button[aria-checked="true"] .ms { color: var(--on-main); }
.visit-list { list-style: none; margin: 0 -8px; padding: 0; }
.visit-list button { width: 100%; justify-content: space-between; border: none; background: transparent; border-radius: 10px; padding: 7px 8px; }
.visit-list button:hover { background: var(--hover); }
.visit-list small { color: var(--muted); }
.viewer { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, 0.9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: zoom-out; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.viewer img { max-width: 96vw; max-height: 86vh; border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.viewer p { color: #fff; margin: 0; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- 1日 --- */
.panel.day { gap: 0; padding-top: 14px; }
.day-player { position: sticky; top: 42px; z-index: 1; background: var(--card-solid); margin: 0 -18px; padding: 6px 18px 10px; border-bottom: 1px solid var(--line); }
.day-now { display: flex; gap: 10px; align-items: center; min-height: 52px; }
.day-now-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--main-soft); color: var(--main); flex: none; font-weight: 900; }
.day-now-icon[style*="background"] { color: #fff; }
.day-now b { display: block; font-size: 1.08em; }
.day-now small { display: block; color: var(--muted); font-size: 0.85em; }
.day-controls { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.day-controls .round { width: 46px; height: 46px; box-shadow: none; }
.day-controls .round.primary { background: var(--main); color: var(--on-main); }
.day-controls .round .ms { font-size: 28px; }
.day-track { flex: 1; min-width: 0; position: relative; }
.day-track input { width: 100%; padding: 0; margin: 6px 0 0; accent-color: var(--main); position: relative; }
.day-marks { position: absolute; left: 0; right: 0; top: 2px; height: 6px; }
.day-marks i { position: absolute; top: 0; height: 6px; border-radius: 3px; background: #00c853; opacity: 0.8; }
.day-track-info { display: flex; justify-content: space-between; align-items: center; font-size: 0.85em; }
.day-time { font-weight: 800; font-variant-numeric: tabular-nums; }
button.speed { padding: 6px 8px; font-weight: 800; color: var(--main); background: transparent; border-color: transparent; }
.day-summary { padding: 12px 0 6px; display: flex; flex-direction: column; gap: 6px; }
.day-total { display: flex; align-items: baseline; gap: 10px; }
.day-total b { font-size: 1.9em; font-weight: 800; color: var(--main); letter-spacing: -0.5px; }
.day-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); }
.day-modes { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.85em; }
.day-modes span { display: inline-flex; align-items: center; gap: 3px; }
.day-modes .ms { font-size: 17px; }
.day-new { font-weight: 700; color: #00b8d4; font-size: 0.9em; }
.day-new:empty { display: none; }
.day-list { list-style: none; margin: 4px -18px 0; padding: 0; }
.day-list .row { position: relative; display: flex; gap: 12px; padding: 10px 18px 10px 22px; cursor: pointer; border-left: 4px solid transparent; }
.day-list .row:hover { background: var(--hover); }
.day-list .row.selected { background: var(--main-soft); }
.day-list .row.now { background: color-mix(in srgb, var(--main) 20%, transparent); border-left-color: var(--main); }
/* The line joining the day's rows (not the tabs' nav.rail: it stays under the sticky player). */
.day-list .rail { position: absolute; left: 39px; top: 0; bottom: 0; width: 3px; background: var(--line); }
.day-list .row:first-child .rail { top: 28px; }
.day-list .row:last-child .rail { bottom: calc(100% - 28px); }
.day-list .row.none .rail { background: repeating-linear-gradient(var(--line) 0 4px, transparent 4px 9px); }
.row-icon { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex: none; background: var(--line); border: 2px solid var(--card-solid); }
.row-icon .ms { font-size: 20px; }
.row.none .row-icon { color: var(--muted); background: var(--card-solid); border-color: var(--line); }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-body .here { display: none; color: var(--main); font-size: 0.75em; }
.row.now .row-body .here { display: block; }
.row-title { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-sub { color: var(--muted); font-size: 0.85em; }
.row-fresh { color: #00b8d4; font-weight: 700; font-size: 0.85em; }
.badge { font-size: 0.72em; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); }
.badge.first { background: color-mix(in srgb, #00e5ff 25%, transparent); color: #00838f; }
.row-photos { display: flex; gap: 6px; overflow-x: auto; }
.row-photos img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; cursor: zoom-in; flex: none; }
.question { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.question .chips button { font-size: 0.85em; }
.day-banner { position: absolute; z-index: 3; top: 84px; left: calc(var(--pl) + (100% - var(--pl)) / 2); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; font-weight: 800; pointer-events: none; max-width: calc(100% - var(--pl) - 24px); }
.day-banner.big { background: var(--main); color: var(--on-main); font-size: 1.1em; }
.day-banner img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.day-banner span { padding: 4px 0 4px 6px; }
/* The day has its own numbers and player: the map's own extras step aside. */
.app:has(.panel.day:not([hidden])) .stack, .app:has(.panel.day:not([hidden])) .periods { display: none; }
@media (max-width: 640px) {
  .panel.day { max-height: 58%; }
  .day-player { top: 30px; }
  .app:has(.panel.day:not([hidden])) .day-banner { top: 70px; }
}

/* --- 道の色 --- */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.themes button { justify-content: flex-start; gap: 8px; padding: 8px 10px; border-radius: 12px; background: transparent; font-weight: 700; font-size: 0.9em; }
.themes button i { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6); }
.themes button[aria-checked="true"] { border-color: var(--main); background: var(--main-soft); }

/* --- 塗り率 --- */
.cities-summary { margin: 0; font-weight: 700; }
.cities { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cities li { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; row-gap: 3px; align-items: end; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.city-name { display: flex; flex-direction: column; min-width: 0; }
.city-name small { color: var(--muted); font-size: 0.75em; }
.city-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-share { font-size: 1.3em; font-weight: 900; color: var(--main); font-variant-numeric: tabular-nums; }
.city-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.city-bar i { display: block; height: 100%; border-radius: 3px; background: var(--main); }
.city-km { grid-column: 1 / -1; color: var(--muted); font-size: 0.78em; }

/* --- 手段を直す --- */
.fix-mode { display: flex; flex-direction: column; gap: 4px; }
.fix-mode .link .ms { font-size: 16px; }
.fix-mode .chips button { font-size: 0.85em; }
.fix-mode .message:empty { display: none; }

/* --- 共有 --- */
.share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.share-list li { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.share-list li.empty { border: none; padding: 4px 0; }
.share-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.share-who b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-who .open-map { color: var(--muted); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; flex: none; }
.share-who .open-map:hover { background: var(--hover); color: var(--main); }
.share-who i { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.share-state { font-size: 0.75em; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); white-space: nowrap; }
.share-state.warn { background: #fff3e0; color: #e65100; }
.share-state.ok { background: color-mix(in srgb, #00c853 18%, transparent); color: #00873a; }
.share-list .chips button { padding: 4px 10px; font-size: 0.85em; }
.share-add { display: flex; gap: 8px; }
.share-add input { flex: 1; }
.fp-memo { margin: 0; white-space: pre-wrap; }
.fp-memo:empty { display: none; }
/* Someone sharing where they are: their initial in a disc of their colour, name and time below. */
.mk.person { z-index: 3; }
.mk.person .disc { position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid #fff; display: grid; place-items: center; color: #fff; font-weight: 900; box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 25%, transparent), 0 1px 4px rgba(0, 0, 0, 0.4); }
.mk.person .name { display: block; top: 20px; }

/* --- 見るだけのリンク: the same app, read only (body.viewing) --- */
.view-name { display: flex; align-items: center; gap: 5px; font-size: 0.82em; color: var(--muted); margin-bottom: 2px; }
.view-name .ms { font-size: 16px; color: var(--main); }
.viewing #account-button, .viewing #more-share, .viewing #export-backup, .viewing .edit-only { display: none !important; }
/* Nothing of the road shown: the views made from it step aside. */
.no-lines #tab-day, .no-lines #more-cities, .no-lines #more-calendar, .no-lines #today-chip, .no-lines .periods, .no-lines #export-gpx { display: none !important; }
/* 見るだけのリンク in the 共有 panel */
.link-new { display: flex; flex-direction: column; gap: 8px; border: 1px dashed var(--line); border-radius: 14px; padding: 10px 12px; }
.link-made { display: flex; gap: 8px; }
.link-made input { flex: 1; font-size: 0.85em; }
