:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-muted: #eff2f3;
  --surface-hover: #e8edee;
  --ink: #20272c;
  --muted: #606c73;
  --subtle: #6c767d;
  --border: #dce2e5;
  --accent: #426b61;
  --accent-hover: #35594f;
  --accent-soft: #e9f0ed;
  --on-accent: #ffffff;
  --warning: #876725;
  --warning-soft: #f5f0e4;
  --rare: #48728c;
  --epic: #80669a;
  --legendary: #97702f;
  --map-bg: #e8edeb;
  --map-filter: none;
  --route-line: #426b61;
  --track-line: #94733e;
  --overlay: rgb(255 255 255 / 95%);
  --scrim: rgb(12 18 22 / 35%);
  --radius: 12px;
  --sidebar-width: 208px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111517;
    --surface: #191e21;
    --surface-muted: #232a2d;
    --surface-hover: #2c3438;
    --ink: #e8edf0;
    --muted: #acb8bf;
    --subtle: #91a0a8;
    --border: #343e43;
    --accent: #a5c2b8;
    --accent-hover: #bfd6ce;
    --accent-soft: #263831;
    --on-accent: #15231e;
    --warning: #d9bc7d;
    --warning-soft: #342d20;
    --rare: #96bed8;
    --epic: #c0a8dd;
    --legendary: #dec080;
    --map-bg: #252f33;
    --map-filter: invert(.93) hue-rotate(180deg) saturate(.48) brightness(.85) contrast(.94);
    --route-line: #a5c2b8;
    --track-line: #dec080;
    --overlay: rgb(25 30 33 / 96%);
    --scrim: rgb(0 0 0 / 60%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111517;
  --surface: #191e21;
  --surface-muted: #232a2d;
  --surface-hover: #2c3438;
  --ink: #e8edf0;
  --muted: #acb8bf;
  --subtle: #91a0a8;
  --border: #343e43;
  --accent: #a5c2b8;
  --accent-hover: #bfd6ce;
  --accent-soft: #263831;
  --on-accent: #15231e;
  --warning: #d9bc7d;
  --warning-soft: #342d20;
  --rare: #96bed8;
  --epic: #c0a8dd;
  --legendary: #dec080;
  --map-bg: #252f33;
  --map-filter: invert(.93) hue-rotate(180deg) saturate(.48) brightness(.85) contrast(.94);
  --route-line: #a5c2b8;
  --track-line: #dec080;
  --overlay: rgb(25 30 33 / 96%);
  --scrim: rgb(0 0 0 / 60%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button, input, select {
  font: inherit;
}

button, a, input, select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
}

button:disabled {
  cursor: default;
  opacity: .5;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -.7px;
}

h1 em {
  font-style: normal;
}

h2 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -.3px;
}

h3 {
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
}

i[data-icon] {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

i svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100dvh;
  display: flex;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 26px 16px 20px;
  z-index: 500;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.5px;
  margin-bottom: 36px;
}

.brand-mark {
  color: var(--accent);
  display: grid;
  place-items: center;
}

.brand-mark img {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

#navigation {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}

.nav-button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.nav-button.active {
  color: var(--ink);
  background: var(--surface-muted);
  font-weight: 600;
}

.nav-count {
  padding: 2px 6px;
  background: var(--surface-hover);
  color: var(--muted);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
}

.sidebar-bottom {
  margin-top: auto;
}

.profile-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 8px 0;
  border-top: 1px solid var(--border);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface-muted);
}

.profile-mini strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  max-width: 126px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.profile-mini span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.workspace {
  width: calc(100% - var(--sidebar-width));
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.topbar {
  height: 66px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.topbar-label {
  color: var(--muted);
  font-size: 13px;
}

.topbar-brand {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.4px;
}

.topbar-brand img {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.icon-button:hover {
  background: var(--surface-hover);
}

main {
  max-width: 1440px;
  margin: auto;
  padding: 28px 32px 20px;
}

.page-heading {
  margin-bottom: 22px;
}

.page-heading p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow {
  display: none;
}

.stats-row {
  display: flex;
  gap: 28px;
  padding: 0 0 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 350px;
  min-width: 0;
}

.stat-card > i {
  color: var(--subtle);
  width: 18px;
  height: 18px;
}

.stat-card strong {
  display: block;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.4px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-card small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.stat-card div > span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

#calorieHint {
  font-size: 11px;
}

.adventure-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  padding-bottom: 8px;
}

.adventure-tabs .nav-button {
  width: auto;
  justify-content: center;
  padding: 9px 16px;
  font-size: 14px;
  min-height: 40px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.walk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: stretch;
}

.planner {
  padding: 20px;
}

.planner h2 {
  margin-bottom: 20px;
  font-size: 17px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  margin-bottom: 8px;
}

.search-field {
  display: flex;
  align-items: center;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 0 0 11px;
  gap: 8px;
  background: var(--surface);
}

.search-field > i {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.search-field input {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 16px;
}

.search-field input::placeholder {
  color: var(--subtle);
}

.search-field input:focus {
  outline: none;
}

.search-field:focus-within {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

.search-field button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--muted);
}

.search-field button:hover {
  color: var(--ink);
}

.search-results {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  max-height: 200px;
  overflow: auto;
  margin: 6px 0;
  padding: 4px;
  font-size: 13px;
}

.search-results button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 8px;
  font-size: 13px;
  border-radius: 6px;
  line-height: 1.4;
}

.search-results button:hover {
  background: var(--surface-muted);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.text-button i {
  width: 16px;
  height: 16px;
}

.text-button:hover {
  color: var(--accent-hover);
}

.selected-start {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.distance-field {
  margin-top: 20px;
}

.distance-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 550;
  margin-bottom: 10px;
  gap: 12px;
}

.distance-heading > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 14px;
  color: var(--muted);
}

.distance-heading input {
  width: 63px;
  padding: 0;
  background: none;
  border: 0;
  text-align: right;
  font-size: 27px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.distance-heading input::-webkit-inner-spin-button {
  display: none;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 18px;
  cursor: pointer;
  margin: 0;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--subtle);
  font-size: 11px;
  margin-top: 2px;
}

.walk-forecast {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 0 0;
  line-height: 1.45;
}

.walk-forecast > span + span::before {
  content: "·";
  margin-right: 12px;
  color: var(--subtle);
}

.preference-field {
  margin-top: 18px;
}

.preference-buttons {
  display: flex;
  gap: 5px;
}

.preference-buttons button {
  flex: 1;
  min-width: 0;
  padding: 10px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
}

.preference-buttons i {
  width: 17px;
  height: 17px;
}

.preference-buttons button.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.reward-preview {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  padding: 15px 0;
}

.reward-preview > i {
  width: 15px;
  height: 15px;
  color: var(--subtle);
}

.reward-preview b {
  font-weight: 500;
  color: var(--ink);
}

.primary-button, .secondary-button, .light-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 9px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.4;
}

.primary-button {
  color: var(--on-accent);
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-hover);
}

.primary-button > i {
  width: 18px;
  height: 18px;
}

.secondary-button, .light-button {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--ink);
}

.secondary-button:hover, .light-button:hover {
  background: var(--surface-hover);
}

.planner .primary-button {
  width: 100%;
}

.microcopy {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.map-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-height: 510px;
}

.map-head {
  height: 42px;
  flex-shrink: 0;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  z-index: 402;
}

.map-badge {
  font-size: 11px;
  color: var(--subtle);
}

#map {
  flex: 1;
  min-height: 466px;
  background: var(--map-bg);
  z-index: 1;
}

.leaflet-container {
  font-family: inherit;
}

.leaflet-tile-pane {
  filter: var(--map-filter);
}

.leaflet-control-attribution {
  font-size: 10px !important;
  background: var(--overlay) !important;
  color: var(--muted) !important;
}

.leaflet-control-attribution a {
  color: var(--accent) !important;
}

.leaflet-control-zoom {
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  border-radius: 9px !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  color: var(--ink) !important;
  background: var(--surface) !important;
  border-bottom-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--surface-hover) !important;
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.leaflet-popup-content-wrapper {
  border: 1px solid var(--border);
  border-radius: 10px;
}

.leaflet-popup-content {
  margin: 14px 18px;
  font-size: 13px;
  line-height: 1.5;
}

.leaflet-container a.leaflet-popup-close-button {
  color: var(--muted);
}

.map-floating {
  position: absolute;
  top: 53px;
  right: 12px;
  z-index: 405;
}

.map-empty {
  position: absolute;
  bottom: 32px;
  left: 14px;
  max-width: calc(100% - 28px);
  width: 280px;
  padding: 13px 15px 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--overlay);
  z-index: 403;
}

.map-empty strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.map-empty > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 4px;
}

.map-empty .text-button {
  font-size: 12px;
}

.route-panel {
  position: absolute;
  z-index: 405;
  left: 12px;
  right: 12px;
  bottom: 28px;
  background: var(--overlay);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.route-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.route-summary strong {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.route-summary strong small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.route-summary p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.route-tag {
  margin-left: auto;
  background: var(--surface-muted);
  border-radius: 6px;
  font-size: 11px;
  color: var(--muted);
  padding: 5px 7px;
  white-space: nowrap;
}

.route-actions {
  display: flex;
  gap: 8px;
}

.route-actions .primary-button {
  flex: 1;
}

.route-actions button {
  padding: 10px 12px;
  min-height: 42px;
  font-size: 13px;
}

.route-warning {
  font-size: 12px;
  color: var(--warning);
  margin: 8px 0;
  line-height: 1.5;
}

.route-loading {
  position: absolute;
  z-index: 430;
  inset: 42px 0 0;
  background: var(--overlay);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 12px;
  text-align: center;
}

.route-loading strong {
  font-size: 15px;
  font-weight: 600;
}

.route-loading > span:not(.spinner) {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.spinner {
  width: 27px;
  height: 27px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.home-marker {
  display: grid !important;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  border: 3px solid var(--surface);
  border-radius: 50%;
  font-size: 18px;
}

.user-marker {
  background: var(--rare);
  border: 3px solid var(--surface);
  border-radius: 50%;
  outline: 5px solid color-mix(in srgb, var(--rare) 22%, transparent);
}

.place-marker {
  display: grid !important;
  place-items: center;
  background: var(--warning-soft);
  color: var(--warning);
  border: 2px solid var(--surface);
  border-radius: 50%;
  font-size: 12px;
}

footer {
  display: flex;
  margin-top: 24px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

footer a:hover {
  text-decoration: underline;
}

.content-grid, .settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel-padding {
  padding: 22px;
}

.section-kicker {
  font-size: 12px;
  color: var(--muted);
  font-weight: 550;
  letter-spacing: .2px;
}

.hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 250px;
  padding: 24px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hero-card h2 {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -.6px;
  margin-top: 12px;
}

.hero-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 10px;
}

.chapter-tag {
  display: inline-block;
  align-self: flex-start;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: .35px;
}

.xp-bar {
  height: 6px;
  border-radius: 10px;
  background: var(--surface-muted);
  overflow: hidden;
  margin: 18px 0 9px;
}

.xp-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
}

.xp-caption {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.attribute-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0;
}

.attribute {
  text-align: center;
  background: var(--surface-muted);
  border-radius: 9px;
  padding: 12px 6px;
}

.attribute strong {
  display: block;
  font-size: 23px;
  font-weight: 600;
}

.attribute span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.class-choice {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.class-choice button {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 42px;
  padding: 9px 12px;
  font-size: 13px;
}

.class-choice button.selected {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.body-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 18px;
}

.section-title h2 {
  font-size: 17px;
}

.wallet {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.item-card {
  position: relative;
  padding: 18px;
}

.item-art {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--muted);
  margin-bottom: 14px;
}

.item-art i {
  width: 25px;
  height: 25px;
}

.item-card h3 {
  margin: 7px 0;
  font-size: 15px;
}

.item-card .body-text {
  font-size: 13px;
}

.rarity-tag {
  font-size: 11px;
  font-weight: 550;
}

.rarity-common {
  color: var(--muted);
}

.rarity-uncommon {
  color: var(--accent);
}

.rarity-rare {
  color: var(--rare);
}

.rarity-epic {
  color: var(--epic);
}

.rarity-legendary {
  color: var(--legendary);
}

.item-card.rare {
  border-top-color: var(--rare);
}

.item-card.epic {
  border-top-color: var(--epic);
}

.item-card.legendary {
  border-top-color: var(--legendary);
}

.item-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  margin-top: 16px;
}

.item-actions button {
  font-size: 12px;
  padding: 9px 10px;
  min-height: 40px;
}

.equipped-label {
  position: absolute;
  top: 18px;
  right: 14px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 5px;
  font-size: 11px;
  padding: 4px 7px;
}

.privacy-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 16px;
}

.quest-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quest-card {
  padding: 20px;
}

.quest-card h3 {
  margin: 10px 0 6px;
}

.quest-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.quest-progress {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-muted);
}

.journal-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px;
  margin-bottom: 12px;
}

.journal-entry h3 {
  margin: 7px 0 4px;
}

.journal-entry p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.journal-entry > strong {
  white-space: nowrap;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.journal-entry small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.journal-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.journal-metrics strong {
  white-space: nowrap;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.journal-metrics span {
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}

.empty-state {
  padding: 40px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  background: var(--surface);
  color: var(--muted);
}

.empty-state > i {
  width: 28px;
  height: 28px;
}

.empty-state h2 {
  margin: 14px 0 8px;
  color: var(--ink);
}

.empty-state p {
  font-size: 14px;
  line-height: 1.65;
}

.empty-state .primary-button {
  margin-top: 22px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 17px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row > div {
  min-width: 0;
}

.setting-row strong {
  display: block;
  font-size: 14px;
  font-weight: 550;
}

.setting-row p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 4px;
}

.setting-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.setting-row input[type="text"], .setting-row input[type="number"], .setting-row select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 16px;
  width: 145px;
  min-width: 0;
}

.setting-row input[type="number"] {
  width: 96px;
}

.setting-row select {
  width: 150px;
}

.weight-input {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.notice {
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 14px;
  line-height: 1.65;
  margin: 18px 0;
}

.calorie-details {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.calorie-details summary {
  cursor: pointer;
  color: var(--ink);
  padding: 8px 0;
}

.calorie-details p {
  padding-top: 6px;
}

.calorie-details a {
  display: inline-block;
  margin-top: 9px;
  color: var(--accent);
}

.settings-grid ul {
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.muted {
  color: var(--muted);
}

.battle-card {
  padding: 22px;
}

.battle-arena {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 15px;
  margin: 18px 0;
  padding: 22px;
  background: var(--surface-muted);
  border-radius: 10px;
  text-align: center;
}

.combatant {
  min-width: 0;
  flex: 1;
  max-width: 190px;
}

.combatant > div:first-child {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  color: var(--accent);
}

.combatant > div:first-child i {
  width: 32px;
  height: 32px;
}

.combatant:last-child > div:first-child {
  color: var(--warning);
}

.combatant h3 {
  font-size: 14px;
}

.combatant .xp-bar {
  margin: 11px 0 7px;
  background: var(--border);
}

.combatant:last-child .xp-bar > span {
  background: var(--warning);
}

.combatant small {
  font-size: 12px;
  color: var(--muted);
}

.battle-arena > span {
  font-size: 13px;
  color: var(--subtle);
}

.battle-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.battle-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 8px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.battle-actions button:hover {
  background: var(--surface-hover);
}

.battle-actions i {
  width: 17px;
  height: 17px;
}

.battle-log {
  margin-top: 17px;
  max-height: 150px;
  overflow: auto;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 5px;
}

.walking-panel {
  position: fixed;
  z-index: 600;
  bottom: 22px;
  left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2);
  transform: translateX(-50%);
  width: min(660px, calc(100% - var(--sidebar-width) - 48px));
  padding: 18px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px var(--scrim);
  border-radius: var(--radius);
}

.walking-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.walking-top button {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
}

.walking-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 14px 0;
}

.walking-main > strong {
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.walking-main small {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

.walking-instruction {
  font-size: 15px;
  line-height: 1.5;
  max-width: 330px;
}

.walking-calories {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
  margin-top: 5px;
  letter-spacing: 0;
}

.walking-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.walking-controls > span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-right: auto;
}

.walking-controls button {
  padding: 10px 13px;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 13px;
  min-height: 42px;
}

.walking-controls button:last-child {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.walking-panel.focus {
  inset: 0;
  transform: none;
  width: 100%;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 800;
  background: var(--bg);
}

.walking-panel.focus .walking-top {
  position: absolute;
  left: 24px;
  right: 24px;
  top: calc(24px + env(safe-area-inset-top));
}

.walking-panel.focus .walking-main {
  display: block;
  text-align: center;
  max-width: 620px;
}

.walking-panel.focus .walking-main > strong {
  display: block;
  font-size: 72px;
}

.walking-panel.focus .walking-instruction {
  max-width: none;
  margin-top: 26px;
  font-size: 27px;
  line-height: 1.5;
}

.walking-panel.focus .walking-calories {
  font-size: 18px;
}

.walking-panel.focus .walking-controls {
  margin-top: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.walking-panel.focus .walking-controls > span {
  flex-basis: 100%;
  text-align: center;
  margin: 0 0 8px;
}

dialog {
  max-width: 520px;
  width: calc(100% - 32px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  color: var(--ink);
  background: var(--surface);
}

dialog::backdrop {
  background: var(--scrim);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 23px;
  border: 0;
  background: none;
}

dialog .section-kicker {
  display: block;
  margin-right: 28px;
}

dialog h2 {
  font-size: 23px;
  line-height: 1.35;
  margin: 12px 24px 14px 0;
}

dialog p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

dialog .inline-actions {
  margin-top: 22px;
}

.loot-reveal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.loot-reveal > div {
  min-width: 140px;
  flex: 1;
  padding: 14px;
  border-radius: 9px;
  background: var(--surface-muted);
}

.loot-reveal strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 14px;
  font-weight: 600;
}

#toast {
  position: fixed;
  z-index: 1000;
  bottom: 24px;
  right: 24px;
  max-width: 390px;
  background: var(--ink);
  color: var(--bg);
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
}

.mobile-only {
  display: none;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 180px;
  }
  .sidebar {
    padding: 24px 12px 20px;
  }
  .brand {
    padding: 0 9px;
    font-size: 18px;
    gap: 8px;
  }
  .nav-button {
    gap: 9px;
  }
  main {
    padding: 26px 24px 20px;
  }
  .topbar {
    padding: 0 24px;
  }
  .walk-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
  }
  .planner {
    padding: 18px;
  }
  .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .route-summary {
    gap: 10px;
  }
  .route-tag {
    display: none;
  }
  .route-actions button {
    padding: 9px;
    font-size: 12px;
  }
}

@media (max-width: 940px) {
  :root {
    --sidebar-width: 72px;
  }
  .sidebar {
    padding: 26px 10px 20px;
  }
  .brand {
    justify-content: center;
    padding: 0;
  }
  .brand > span:last-child, .sidebar .nav-button > span, .sidebar-bottom {
    display: none;
  }
  .sidebar .nav-button {
    justify-content: center;
    padding: 12px 8px;
  }
  .sidebar .nav-button i {
    width: 22px;
    height: 22px;
  }
  .walk-grid {
    grid-template-columns: minmax(0, 1fr) 285px;
    gap: 14px;
  }
  main {
    padding: 24px 20px 20px;
  }
  .topbar {
    padding: 0 20px;
  }
  .content-grid, .settings-grid {
    grid-template-columns: 1fr;
  }
  .hero-card {
    min-height: 210px;
  }
  .map-card {
    min-height: 490px;
  }
  #map {
    min-height: 446px;
  }
  .map-badge {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --sidebar-width: 0px;
  }
  .sidebar {
    inset: auto 0 0;
    width: 100%;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-right: 0;
    border-top: 1px solid var(--border);
    z-index: 590;
  }
  .sidebar .brand {
    display: none;
  }
  #navigation {
    flex-direction: row;
    gap: 4px;
  }
  .sidebar .nav-button {
    flex: 1;
    flex-direction: column;
    gap: 5px;
    padding: 7px 4px;
    min-height: 52px;
    border-radius: 9px;
  }
  .sidebar .nav-button > span {
    display: block;
    font-size: 11px;
  }
  .sidebar .nav-button i {
    width: 21px;
    height: 21px;
  }
  .sidebar .nav-button.active {
    color: var(--accent);
    background: var(--accent-soft);
  }
  .workspace {
    margin-left: 0;
    width: 100%;
  }
  .topbar {
    height: 60px;
    padding: 0 18px;
    background: var(--surface);
  }
  .topbar-brand {
    display: flex;
  }
  .topbar-label {
    display: none;
  }
  .topbar-right {
    gap: 5px;
  }
  .topbar .icon-button {
    border: 0;
    background: none;
    width: 38px;
    height: 38px;
  }
  main {
    padding: 16px 18px calc(88px + env(safe-area-inset-bottom));
  }
  h1 {
    font-size: 25px;
  }
  .page-heading {
    margin-bottom: 13px;
  }
  .page-heading p {
    font-size: 13px;
    margin-top: 4px;
  }
  .stats-row {
    margin-bottom: 14px;
    padding-bottom: 12px;
    gap: 18px;
  }
  .stat-card {
    gap: 8px;
  }
  .stat-card > div {
    min-width: 0;
  }
  .stat-card > i {
    display: none;
  }
  .stat-card strong {
    font-size: 22px;
  }
  .stat-card div > span {
    font-size: 11px;
    margin-top: 3px;
  }
  #calorieHint {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .walk-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .map-card {
    height: auto;
    min-height: 320px;
    flex-shrink: 0;
  }
  .map-head {
    height: 36px;
    font-size: 12px;
    padding: 0 12px;
  }
  .map-badge {
    display: block;
    font-size: 10px;
  }
  #map {
    height: 282px;
    min-height: 282px;
    flex: none;
  }
  .map-floating {
    top: 46px;
    right: 10px;
  }
  .map-floating .icon-button {
    width: 36px;
    height: 36px;
  }
  .map-empty {
    left: 10px;
    bottom: 27px;
    padding: 11px 13px 3px;
    max-width: calc(100% - 20px);
    width: 274px;
  }
  .map-empty strong {
    font-size: 13px;
  }
  .map-empty > span {
    font-size: 12px;
  }
  .route-panel {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    padding: 13px 12px;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    background: var(--surface);
  }
  .route-summary {
    margin-bottom: 9px;
  }
  .route-summary strong {
    font-size: 24px;
  }
  .route-summary p {
    font-size: 11px;
  }
  .route-warning {
    font-size: 11px;
    margin: 5px 0;
  }
  .route-actions {
    gap: 6px;
  }
  .route-actions button {
    min-height: 40px;
    font-size: 12px;
    padding: 9px;
  }
  .route-loading {
    inset: 36px 0 auto;
    height: 282px;
  }
  .planner {
    padding: 18px;
  }
  .planner h2 {
    font-size: 17px;
    margin-bottom: 18px;
  }
  .distance-field {
    margin-top: 16px;
  }
  .distance-heading {
    margin-bottom: 8px;
  }
  .preference-field {
    margin-top: 17px;
  }
  .preference-buttons button {
    flex-direction: row;
    justify-content: center;
    gap: 6px;
    padding: 11px 5px;
  }
  .reward-preview {
    padding: 15px 0;
  }
  .walk-forecast {
    gap: 4px 9px;
  }
  .walk-forecast > span + span::before {
    margin-right: 9px;
  }
  .adventure-tabs {
    margin-bottom: 18px;
    padding-bottom: 8px;
  }
  .adventure-tabs .nav-button {
    flex: 1;
    min-width: 0;
    padding: 9px 10px;
  }
  .content-grid, .settings-grid, .quest-list {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hero-card {
    min-height: 200px;
    padding: 21px;
  }
  .hero-card h2 {
    font-size: 26px;
  }
  .panel-padding {
    padding: 20px;
  }
  .attribute-grid {
    gap: 7px;
  }
  .attribute {
    padding: 12px 5px;
  }
  .attribute strong {
    font-size: 21px;
  }
  .attribute span {
    font-size: 11px;
  }
  .inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .item-card {
    padding: 14px;
  }
  .item-card h3 {
    font-size: 14px;
  }
  .item-art {
    margin-bottom: 14px;
    width: 38px;
    height: 38px;
  }
  .item-art i {
    width: 22px;
    height: 22px;
  }
  .item-card .body-text {
    font-size: 12px;
  }
  .equipped-label {
    right: 10px;
    top: 14px;
    font-size: 10px;
    padding: 3px 5px;
  }
  .section-title {
    align-items: flex-start;
    gap: 12px;
  }
  .section-title h2 {
    font-size: 16px;
  }
  .wallet {
    font-size: 12px;
    gap: 3px 9px;
  }
  .rarity-tag {
    font-size: 10px;
  }
  .journal-entry {
    padding: 16px;
    gap: 14px;
  }
  .journal-entry h3 {
    font-size: 14px;
  }
  .journal-entry p {
    font-size: 12px;
  }
  .journal-entry > strong {
    font-size: 21px;
  }
  .journal-metrics strong {
    font-size: 21px;
  }
  .battle-card {
    padding: 18px;
  }
  .battle-arena {
    padding: 18px 12px;
  }
  .battle-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .battle-log {
    font-size: 12px;
  }
  .setting-row {
    gap: 14px;
  }
  .setting-row input[type="text"] {
    width: 128px;
  }
  .setting-row select {
    width: 128px;
  }
  .inline-actions > button {
    flex-grow: 1;
  }
  .walking-panel {
    left: 50%;
    width: calc(100% - 20px);
    bottom: calc(78px + env(safe-area-inset-bottom));
    padding: 15px;
  }
  .walking-top {
    font-size: 10px;
    gap: 10px;
  }
  .walking-top button {
    font-size: 11px;
    padding: 7px;
  }
  .walking-main {
    gap: 15px;
    margin: 13px 0;
  }
  .walking-main > strong {
    font-size: 28px;
  }
  .walking-instruction {
    font-size: 13px;
    max-width: 240px;
  }
  .walking-controls {
    flex-wrap: wrap;
    gap: 8px;
  }
  .walking-controls > span {
    flex-basis: 100%;
    font-size: 11px;
  }
  .walking-controls button {
    flex: 1;
    font-size: 13px;
  }
  .walking-panel.focus {
    bottom: 0;
    width: 100%;
    padding: 24px;
  }
  .walking-panel.focus .walking-main > strong {
    font-size: 66px;
  }
  .walking-panel.focus .walking-instruction {
    font-size: 24px;
  }
  .walking-panel.focus .walking-controls {
    width: 100%;
    max-width: 380px;
  }
  #toast {
    left: 12px;
    right: 12px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    max-width: none;
    font-size: 13px;
  }
  dialog {
    padding: 24px 20px;
    width: calc(100% - 24px);
  }
  dialog h2 {
    font-size: 22px;
  }
  .mobile-only {
    display: grid;
  }
}

@media (max-width: 370px) {
  main {
    padding-left: 14px;
    padding-right: 14px;
  }
  .planner {
    padding: 16px;
  }
  .preference-buttons button {
    font-size: 11px;
    gap: 4px;
  }
  .preference-buttons i {
    width: 15px;
    height: 15px;
  }
  .inventory-grid {
    grid-template-columns: 1fr;
  }
  .item-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .item-actions button {
    flex: 1;
  }
  .setting-row input[type="text"], .setting-row select {
    width: 115px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
  .spinner {
    animation: none;
  }
}

/* The walking view is a map; preparation opens above it when needed. */
:root {
  --topbar-height: 58px;
  --bottom-nav-height: 0px;
  --map-control-shadow: 0 2px 9px rgb(0 0 0 / 10%);
}

body[data-view="marche"] {
  overflow: hidden;
}

body[data-view="marche"] .workspace {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--bottom-nav-height);
}

body[data-view="marche"] .topbar {
  height: var(--topbar-height);
  flex-shrink: 0;
  background: var(--surface);
}

body[data-view="marche"] main {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
}

body[data-view="marche"] #pageHeading,
body[data-view="marche"] #activityStats,
body[data-view="marche"] main > footer {
  display: none;
}

body[data-view="marche"] #view-marche,
body[data-view="marche"] .walk-grid {
  height: 100%;
  min-height: 0;
}

body[data-view="marche"] .walk-grid {
  display: block;
  position: relative;
  isolation: isolate;
}

body[data-view="marche"] .map-card {
  height: 100%;
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
}

body[data-view="marche"] #map {
  height: 100%;
  min-height: 0;
  flex: 1;
}

.map-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 72px;
  z-index: 405;
  pointer-events: none;
}

.map-options-button {
  min-height: 46px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--map-control-shadow);
  font-size: 13px;
  font-weight: 550;
  pointer-events: auto;
}

.map-options-button:hover {
  background: var(--surface-muted);
}

.map-options-button > i {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

#routeOptionsLabel {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#routeOptionsSummary {
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

body[data-view="marche"] .map-floating {
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body[data-view="marche"] .map-floating .icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: var(--map-control-shadow);
}

body[data-view="marche"] .leaflet-top.leaflet-left {
  top: 72px;
  left: 6px;
}

body[data-view="marche"] .leaflet-control-zoom {
  box-shadow: var(--map-control-shadow) !important;
}

body[data-view="marche"] .leaflet-control-zoom a {
  width: 34px;
  height: 34px;
  line-height: 34px;
}

body[data-view="marche"] .map-empty {
  left: 16px;
  bottom: 26px;
  width: 300px;
  max-width: calc(100% - 32px);
  padding: 13px 15px 4px;
  border-radius: 14px;
  box-shadow: var(--map-control-shadow);
}

body[data-view="marche"] .route-panel {
  position: absolute;
  left: 16px;
  right: auto;
  bottom: 26px;
  width: min(430px, calc(100% - 32px));
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--map-control-shadow);
}

body[data-view="marche"] .route-summary {
  gap: 14px;
  margin-bottom: 10px;
}

body[data-view="marche"] .route-summary strong {
  font-size: 25px;
}

body[data-view="marche"] .route-summary p {
  font-size: 12px;
  line-height: 1.45;
}

body[data-view="marche"] .route-tag {
  display: none;
}

body[data-view="marche"] .route-actions button {
  min-height: 44px;
  font-size: 13px;
  padding: 10px 12px;
}

body[data-view="marche"] .route-loading {
  inset: 0;
  height: auto;
}

.route-options-backdrop {
  position: absolute;
  inset: 0;
  z-index: 610;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: var(--scrim);
  cursor: default;
}

.route-options-sheet {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 620;
  width: min(420px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 30px var(--scrim);
  scrollbar-width: thin;
  scroll-padding-block: 16px;
}

.route-options-sheet:focus {
  outline: none;
}

.sheet-handle {
  display: none;
}

.sheet-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.sheet-heading h2,
.planner .sheet-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.sheet-heading p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.sheet-heading .icon-button {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--surface-muted);
  border: 0;
  border-radius: 50%;
  font-size: 23px;
  font-weight: 300;
  line-height: 1;
}

.route-options-sheet .preference-buttons button {
  flex-direction: row;
  justify-content: center;
  min-height: 44px;
  padding: 10px 5px;
  gap: 6px;
}

.route-options-sheet .reward-preview {
  padding: 16px 0;
  font-size: 11px;
}

body[data-view="marche"]:has(#walkingPanel:not([hidden])) .map-toolbar,
body[data-view="marche"]:has(#walkingPanel:not([hidden])) .route-panel,
body[data-view="marche"]:has(#walkingPanel:not([hidden])) .map-empty {
  display: none;
}

body[data-view="marche"] .walking-panel,
body[data-view="marche"] .walking-panel.focus {
  position: fixed;
  inset: auto auto 26px calc(var(--sidebar-width) + 16px);
  transform: none;
  width: min(480px, calc(100% - var(--sidebar-width) - 32px));
  height: auto;
  max-height: calc(100dvh - var(--topbar-height) - 40px);
  overflow-y: auto;
  display: block;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--map-control-shadow);
  z-index: 600;
}

body[data-view="marche"] .walking-top,
body[data-view="marche"] .walking-panel.focus .walking-top {
  position: static;
  font-size: 11px;
  gap: 8px;
}

body[data-view="marche"] .walking-top button {
  min-height: 34px;
  font-size: 11px;
  padding: 6px 9px;
}

body[data-view="marche"] .walking-main,
body[data-view="marche"] .walking-panel.focus .walking-main {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  text-align: left;
  margin: 12px 0;
}

body[data-view="marche"] .walking-main > strong,
body[data-view="marche"] .walking-panel.focus .walking-main > strong {
  font-size: 30px;
}

body[data-view="marche"] .walking-instruction,
body[data-view="marche"] .walking-panel.focus .walking-instruction {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  max-width: none;
}

body[data-view="marche"] .walking-controls,
body[data-view="marche"] .walking-panel.focus .walking-controls {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  max-width: none;
  gap: 8px;
}

body[data-view="marche"] .walking-controls > span,
body[data-view="marche"] .walking-panel.focus .walking-controls > span {
  display: block;
  flex-basis: 100%;
  font-size: 11px;
}

body[data-view="marche"] .walking-controls button {
  flex: 1;
  min-height: 42px;
  font-size: 13px;
  padding: 9px 12px;
}

body[data-view="marche"] .walking-panel.focus .walking-main > strong {
  font-size: 40px;
}

body[data-view="marche"] .walking-panel.focus .walking-instruction {
  font-size: 15px;
}

@media (max-width: 760px) {
  :root {
    --topbar-height: calc(52px + env(safe-area-inset-top));
    --bottom-nav-height: calc(65px + env(safe-area-inset-bottom));
  }

  .topbar {
    height: var(--topbar-height);
    padding: env(safe-area-inset-top) 14px 0;
  }

  .topbar-brand {
    font-size: 16px;
  }

  .sidebar {
    height: var(--bottom-nav-height);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }

  .sidebar .nav-button {
    min-height: 52px;
    border-radius: 10px;
    gap: 4px;
    padding: 6px 4px;
  }

  .sidebar .nav-button.active {
    background: none;
    color: var(--accent);
  }

  .map-toolbar {
    top: 12px;
    left: 12px;
    right: 68px;
  }

  .map-options-button {
    padding: 11px 13px;
    gap: 8px;
    font-size: 12px;
    min-height: 44px;
  }

  #routeOptionsSummary {
    padding-left: 8px;
    font-size: 11px;
  }

  body[data-view="marche"] .map-floating {
    top: 12px;
    right: 12px;
  }

  body[data-view="marche"] .leaflet-top.leaflet-left {
    top: 64px;
    left: 2px;
  }

  body[data-view="marche"] .map-empty,
  body[data-view="marche"] .route-panel {
    left: 12px;
    right: 12px;
    bottom: 22px;
    width: auto;
    max-width: 480px;
    margin: 0 auto;
  }

  body[data-view="marche"] .map-empty {
    padding: 13px 14px 4px;
  }

  body[data-view="marche"] .route-panel {
    padding: 12px;
  }

  .route-options-sheet {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: calc(100% - 12px);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    padding: 10px 20px 18px;
    scroll-padding-block: 18px;
  }

  .sheet-handle {
    display: block;
    height: 4px;
    width: 32px;
    margin: 0 auto 14px;
    border-radius: 4px;
    background: var(--border);
  }

  .sheet-heading {
    margin-bottom: 18px;
  }

  .route-options-sheet .reward-preview {
    padding: 14px 0;
  }

  body[data-view="marche"] .walking-panel,
  body[data-view="marche"] .walking-panel.focus {
    inset: auto 12px calc(var(--bottom-nav-height) + 22px) 12px;
    width: auto;
    max-width: 480px;
    max-height: calc(100dvh - var(--topbar-height) - var(--bottom-nav-height) - 36px);
    margin: 0 auto;
    padding: 12px;
  }

  body[data-view="marche"] .walking-main,
  body[data-view="marche"] .walking-panel.focus .walking-main {
    gap: 16px;
  }

  body[data-view="marche"] .walking-main > strong {
    font-size: 28px;
  }

  body[data-view="marche"] #toast {
    bottom: calc(var(--bottom-nav-height) + 16px);
    z-index: 900;
  }
}

@media (max-width: 370px) {
  .map-options-button {
    gap: 7px;
    padding: 10px 12px;
  }

  .map-options-button > i {
    display: none;
  }

  .route-options-sheet {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.route-details {font-size:12px;color:var(--muted);margin:0 0 10px}
.route-details summary {cursor:pointer}
body[data-route-options="open"] .map-options-button {visibility:hidden}

.gps-quality {
 position: absolute; top: 78px; left: 16px; z-index: 500;
 max-width: calc(100% - 100px); padding: 8px 11px;
 border: 1px solid var(--border); border-radius: 12px;
 background: var(--surface); color: var(--ink);
 box-shadow: var(--map-control-shadow); font-size: 12px; line-height: 1.4;
 pointer-events: none;
}
body[data-view="marche"]:has(#walkingPanel:not([hidden])) .gps-quality {top: 16px; left: 68px}
@media (max-width:760px) { .gps-quality {left: 14px; top: 76px} }
