:root {
  color-scheme: light;
  --ink: #18345a;
  --ink-soft: #50647f;
  --blue: #28518a;
  --blue-deep: #173e78;
  --blue-pale: #eaf0f9;
  --coral: #ef735f;
  --paper: #f5f4ef;
  --panel: rgba(255, 255, 255, 0.96);
  --card: #ffffff;
  --line: #e7e6df;
  --line-strong: #d7d8d4;
  --muted: #8794a4;
  --green: #3f8c6a;
  --amber: #d79b35;
  --violet: #8d68c5;
  --shadow: 0 18px 50px rgba(38, 48, 59, 0.13);
  --shadow-soft: 0 9px 28px rgba(38, 48, 59, 0.09);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(40, 81, 138, 0.24);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-shell,
.map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
}

.map-stage {
  background: #f0efe9;
}

.map-canvas,
.demo-map,
.route-overlay,
.marker-layer {
  position: absolute;
  inset: 0;
}

.map-canvas {
  z-index: 1;
  left: 432px;
  background: #f1f0eb;
  transition: left 0.25s ease;
}

.map-canvas:empty {
  visibility: hidden;
}

body.panel-hidden .map-canvas {
  left: 0;
}

.demo-map {
  z-index: 1;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background-color: #ecebe5;
  background-image:
    linear-gradient(rgba(218, 218, 211, 0.45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(218, 218, 211, 0.45) 1px, transparent 1px);
  background-size: 48px 48px;
}

.demo-map.is-dragging {
  cursor: grabbing;
}

.demo-map__surface {
  position: absolute;
  inset: -24%;
  will-change: transform;
}

.demo-map__base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-label {
  position: absolute;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 8px;
  color: #727b78;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 2px 7px rgba(43, 49, 46, 0.06);
  font-size: 12px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.map-label--small {
  color: #989d99;
  font-size: 10px;
}

.route-overlay {
  z-index: 3;
  overflow: visible;
  pointer-events: none;
}

.route-overlay path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.route-overlay .route-halo {
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 11;
}

.route-overlay .route-line {
  stroke-width: 5;
}

.route-overlay .route-line--walk {
  stroke-dasharray: 3 8;
}

.route-overlay .route-line--bike {
  stroke-dasharray: 9 5;
}

.route-overlay .route-line--offline-fallback {
  stroke-dasharray: 6 9;
  stroke-opacity: 0.72;
}

.marker-layer {
  z-index: 4;
  pointer-events: none;
}

.map-marker {
  position: absolute;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 8px;
  place-items: center;
  color: var(--marker-color, var(--blue));
  background: #fff;
  border-color: var(--marker-color, var(--blue));
  box-shadow: 0 8px 18px rgba(25, 45, 65, 0.28);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  pointer-events: auto;
  transform: translate(-50%, -100%) rotate(-45deg);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.map-marker__inner {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  transform: rotate(45deg);
}

.map-marker__emoji {
  font-size: 17px;
  filter: saturate(1.05);
}

.map-marker__count {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 9px;
  place-items: center;
  color: #fff;
  background: var(--marker-color, var(--blue));
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(45deg);
}

.map-marker:hover,
.map-marker.is-active {
  z-index: 3;
  box-shadow: 0 11px 22px rgba(25, 45, 65, 0.34);
  transform: translate(-50%, -100%) rotate(-45deg) scale(1.16);
}

.map-marker.is-muted {
  opacity: 0.45;
  filter: grayscale(0.45);
}

.user-location-marker {
  position: absolute;
  display: grid;
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50%;
  place-items: center;
  background: #347ee3;
  box-shadow: 0 2px 8px rgba(38, 92, 164, 0.35);
  pointer-events: none;
}

.user-location-marker::before,
.user-location-marker::after {
  position: absolute;
  border-radius: 50%;
  background: rgba(52, 126, 227, 0.18);
  content: "";
  animation: location-pulse 2.1s ease-out infinite;
}

.user-location-marker::before {
  width: 42px;
  height: 42px;
}

.user-location-marker::after {
  width: 68px;
  height: 68px;
  animation-delay: 0.55s;
}

.user-location-marker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

@keyframes location-pulse {
  0% {
    opacity: 0.7;
    transform: scale(0.45);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

.amap-location-marker {
  display: grid;
  width: 38px;
  height: 38px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 8px;
  place-items: center;
  color: var(--marker-color, var(--blue));
  background: #fff;
  border-color: var(--marker-color, var(--blue));
  box-shadow: 0 8px 18px rgba(25, 45, 65, 0.28);
  font-size: 13px;
  font-weight: 800;
  transform: rotate(-45deg);
}

.amap-location-marker__inner {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  transform: rotate(45deg);
}

.amap-location-marker__emoji {
  font-size: 17px;
}

.amap-location-marker__count {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 9px;
  place-items: center;
  color: #fff;
  background: var(--marker-color, var(--blue));
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  transform: rotate(45deg);
}

.candidate-map-marker {
  position: absolute;
  display: grid;
  width: 42px;
  height: 42px;
  border: 3px dashed #fff;
  border-radius: 50%;
  place-items: center;
  background: var(--marker-color, var(--blue));
  box-shadow: 0 0 0 2px var(--marker-color, var(--blue)), 0 9px 20px rgba(25, 45, 65, 0.24);
  font-size: 18px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.candidate-map-marker span {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}

.candidate-map-marker--amap {
  position: relative;
  transform: none;
}

.transport-origin-marker {
  display: grid;
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border: 2px solid #fff;
  border-radius: 9px;
  place-items: center;
  color: #fff;
  background: var(--green);
  box-shadow: 0 6px 16px rgba(45, 103, 79, 0.24);
  font-size: 9px;
  font-weight: 800;
}

.topbar {
  position: absolute;
  z-index: 20;
  top: max(16px, env(safe-area-inset-top));
  right: 20px;
  left: 20px;
  display: grid;
  grid-template-columns: auto minmax(260px, 560px) 1fr;
  gap: 14px;
  align-items: center;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.brand {
  display: flex;
  width: fit-content;
  min-width: 112px;
  height: 52px;
  align-items: center;
  gap: 9px;
  padding: 0 18px 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  backdrop-filter: blur(15px);
}

.brand__mark {
  display: grid;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  place-items: center;
  color: #fff;
  background: var(--blue);
}

.brand__word {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 0.92;
}

.brand__word strong {
  font-size: 17px;
  letter-spacing: 0.08em;
}

.brand__word small {
  color: #77879a;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand__mark svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand__mark svg circle:last-child {
  fill: var(--coral);
  stroke: #fff;
}

.place-search {
  position: relative;
  display: flex;
  height: 52px;
  min-width: 0;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(15px);
}

.place-search__icon {
  display: grid;
  width: 48px;
  height: 100%;
  flex: 0 0 48px;
  place-items: center;
}

.place-search__icon svg {
  width: 21px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.place-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.place-search input::placeholder {
  color: #98a1ac;
}

.place-search kbd {
  margin-right: 11px;
  padding: 4px 7px;
  border: 1px solid #e2e5e8;
  border-bottom-width: 2px;
  border-radius: 6px;
  color: #9ba4ae;
  background: #f8fafb;
  font-family: inherit;
  font-size: 10px;
  white-space: nowrap;
}

.search-results {
  position: absolute;
  z-index: 80;
  top: calc(100% + 9px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid #e5e7e5;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.search-result {
  display: grid;
  width: 100%;
  grid-template-columns: 37px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 15px;
  border: 0;
  border-bottom: 1px solid #f0f1ee;
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result:hover {
  background: #f7f9fb;
}

.search-result__icon {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  place-items: center;
  color: var(--result-color, var(--blue));
  background: color-mix(in srgb, var(--result-color, var(--blue)) 12%, white);
  font-size: 16px;
}

.search-result__copy {
  min-width: 0;
}

.search-result__copy strong,
.search-result__copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result__copy strong {
  font-size: 13px;
}

.search-result__copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.search-result__add {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.search-empty {
  padding: 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.topbar__actions {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 9px;
}

.share-mode-pill,
.cloud-status-pill,
.share-button,
.icon-button {
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(15px);
}

.share-mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 16px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.cloud-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 16px;
  color: #35775a;
  font-size: 10px;
  font-weight: 800;
}

.cloud-status-pill.is-saving {
  color: #9a742c;
}

.cloud-status-pill.is-error {
  color: #bd5548;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: 16px;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.share-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button {
  display: grid;
  width: 48px;
  padding: 0;
  border-radius: 16px;
  place-items: center;
  cursor: pointer;
}

.icon-button--ghost {
  color: var(--ink-soft);
}

.icon-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.itinerary-panel {
  position: absolute;
  z-index: 12;
  top: calc(max(16px, env(safe-area-inset-top)) + 66px);
  bottom: 18px;
  left: 20px;
  display: flex;
  width: min(435px, calc(100vw - 40px));
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.itinerary-panel.is-collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-28px);
}

.panel-collapse {
  position: absolute;
  z-index: 3;
  top: 20px;
  right: 18px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: #8190a2;
  background: #f2f4f5;
  place-items: center;
  cursor: pointer;
}

.panel-collapse svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.trip-heading {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  gap: 16px;
  padding: 27px 25px 15px;
}

.eyebrow,
.sheet-kicker {
  margin: 0 0 6px;
  color: #98a1a9;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.trip-heading h1 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(23px, 2.2vw, 30px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 7px 0 0;
  color: #718197;
  font-size: 12px;
}

.dot {
  color: #aab2bc;
}

.trip-edit {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  margin-right: 39px;
  padding: 0;
  border: 1px solid #e9e8e2;
  border-radius: 11px;
  place-items: center;
  color: #8390a0;
  background: #fff;
  cursor: pointer;
}

.trip-edit svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.day-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  overflow-x: auto;
  padding: 0 25px 15px;
  scrollbar-width: none;
}

.day-tabs::-webkit-scrollbar {
  display: none;
}

.day-tab {
  min-width: 54px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  color: #6c7f99;
  background: #e9eef4;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.day-tab:hover {
  background: #e1e8f1;
}

.day-tab.is-active {
  color: #fff;
  background: var(--blue-deep);
  box-shadow: 0 7px 14px rgba(23, 62, 120, 0.22);
}

.day-context {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px 15px;
  color: #61738b;
  font-size: 12px;
}

.day-context > div {
  display: flex;
  align-items: center;
  gap: 15px;
}

.day-city {
  color: var(--blue);
  font-weight: 700;
}

.day-city span {
  margin-right: 3px;
  font-size: 9px;
}

.weather {
  gap: 5px !important;
  color: #8d99a6;
}

.weather svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.route-summary {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin: 0 18px 9px;
  padding: 10px 12px;
  border: 1px solid #e9edf2;
  border-radius: 13px;
  color: #647891;
  background: #f5f8fb;
  font-size: 11px;
}

.route-summary strong {
  color: var(--ink);
  font-weight: 800;
}

.route-summary__icon {
  display: grid;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  place-items: center;
  color: var(--blue);
  background: #fff;
}

.timeline-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 18px 20px;
  scrollbar-color: #ccd3db transparent;
  scrollbar-width: thin;
}

.timeline-scroll::-webkit-scrollbar {
  width: 6px;
}

.timeline-scroll::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: #d8dce0;
}

.timeline {
  position: relative;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 34px 18px;
  border: 1px dashed #ccd5de;
  border-radius: 18px;
  color: #8391a0;
  text-align: center;
  background: #f8fafb;
}

.empty-state strong {
  color: #657a91;
  font-size: 13px;
}

.empty-state span {
  font-size: 10px;
}

.stop-block {
  position: relative;
}

.stop-block.is-dragging {
  opacity: 0.45;
}

.stop-card {
  position: relative;
  display: grid;
  grid-template-columns: 50px 1fr 20px;
  gap: 11px;
  align-items: start;
  padding: 16px 14px 15px 12px;
  border: 1px solid #e9e8e2;
  border-radius: 19px;
  background: var(--card);
  box-shadow: 0 4px 12px rgba(37, 50, 60, 0.035);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.stop-card.is-drop-target {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40, 81, 138, 0.1);
}

.stop-card:hover {
  border-color: #d4dce6;
  box-shadow: 0 10px 22px rgba(37, 50, 60, 0.08);
  transform: translateY(-1px);
}

.stop-card.is-active {
  border-color: color-mix(in srgb, var(--day-color) 40%, white);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--day-color) 9%, transparent), 0 10px 22px rgba(37, 50, 60, 0.08);
}

.stop-card.is-done {
  background: #fbfcfb;
}

.stop-card.is-done .stop-title {
  color: #667b70;
}

.stop-card.is-skipped {
  opacity: 0.58;
  background: #f9f9f7;
}

.stop-card.is-skipped .stop-title,
.stop-card.is-skipped .stop-address {
  text-decoration: line-through;
}

.stop-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stop-icon {
  display: grid;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  place-items: center;
  color: var(--type-color);
  background: color-mix(in srgb, var(--type-color) 12%, white);
  font-size: 20px;
}

.stop-number {
  position: absolute;
  top: -5px;
  left: 1px;
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 12px;
  place-items: center;
  color: var(--blue);
  background: #eaf0f8;
  font-size: 10px;
  font-weight: 900;
}

.stop-body {
  min-width: 0;
}

.stop-kicker {
  display: flex;
  min-height: 15px;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: #8291a3;
  font-size: 10px;
}

.stop-kicker strong {
  color: var(--type-color);
  font-weight: 800;
}

.status-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
  color: #5f806f;
  background: #e8f4ed;
  font-weight: 700;
}

.status-label--skipped {
  color: #8b7770;
  background: #f1ece9;
}

.stop-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.32;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.stop-address {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 5px;
  color: #8a98a7;
  font-size: 10px;
  line-height: 1.5;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.stop-note {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 0;
  color: #5e7087;
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.transport-endpoint-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
}

.transport-endpoint-chips span {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 9px;
  border-radius: 8px;
  color: #536d89;
  background: #eef3f8;
  font-size: 9px;
  font-weight: 700;
}

.transport-endpoint-chips i {
  color: #9ca9b5;
  font-style: normal;
  font-size: 11px;
}

.link-preview {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  margin-top: 10px;
  padding: 9px;
  border: 1px solid #edf0f2;
  border-radius: 12px;
  background: #f8fafb;
  text-decoration: none;
}

.link-preview__icon {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  place-items: center;
  color: var(--link-color, var(--blue));
  background: color-mix(in srgb, var(--link-color, var(--blue)) 12%, white);
  font-size: 14px;
  font-weight: 900;
}

.link-preview__copy {
  min-width: 0;
}

.link-preview__copy strong,
.link-preview__copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-preview__copy strong {
  color: #526780;
  font-size: 10px;
  font-weight: 700;
}

.link-preview__copy small {
  margin-top: 2px;
  color: #97a1ad;
  font-size: 9px;
}

.link-preview > svg {
  width: 14px;
  fill: none;
  stroke: #9ba6b2;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.stop-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.status-toggle,
.open-stop {
  display: grid;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 1px solid #dfe3e5;
  border-radius: 7px;
  place-items: center;
  color: #98a3ad;
  background: #fff;
  cursor: pointer;
}

.status-toggle svg,
.open-stop svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.status-toggle:hover {
  color: var(--green);
  border-color: #b7d8c7;
}

.stop-card.is-done .status-toggle {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.stop-card.is-skipped .status-toggle {
  color: #8f7a73;
  border-color: #dfd4cf;
  background: #f2ece9;
}

.open-stop {
  border-color: transparent;
  background: transparent;
}

.leg-row {
  position: relative;
  display: flex;
  min-height: 54px;
  align-items: center;
  padding-left: 31px;
}

.leg-row::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 31px;
  width: 2px;
  background: color-mix(in srgb, var(--day-color) 26%, #e9ebe9);
  content: "";
}

.leg-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  max-width: 100%;
  height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 13px 0 10px;
  border: 1px solid #e1e6eb;
  border-radius: 12px;
  color: #667b93;
  background: rgba(251, 252, 252, 0.98);
  box-shadow: 0 2px 8px rgba(44, 55, 64, 0.035);
  cursor: pointer;
  font-size: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.leg-button:hover {
  border-color: #cbd8e6;
  background: #fff;
}

.leg-button__mode {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--blue);
  font-weight: 800;
  white-space: nowrap;
}

.leg-button__time {
  white-space: nowrap;
}

.leg-button__distance {
  color: #9aa4ae;
  white-space: nowrap;
}

.leg-button svg {
  width: 12px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.candidate-section {
  margin-top: 18px;
}

.candidate-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 3px 9px;
  color: #8491a0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.candidate-heading span:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
}

.candidate-heading svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.candidate-group {
  margin-bottom: 13px;
}

.candidate-group__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 4px 7px;
  color: #70839b;
  font-size: 10px;
  font-weight: 800;
}

.candidate-list {
  display: grid;
  gap: 7px;
}

.candidate-card {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid #e8e7e1;
  border-radius: 15px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.candidate-card:hover,
.candidate-card.is-active {
  border-color: #b8cadc;
  background: #f9fbfd;
}

.candidate-card__icon {
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  place-items: center;
  color: var(--type-color);
  background: color-mix(in srgb, var(--type-color) 12%, white);
  font-size: 16px;
}

.candidate-card__copy {
  min-width: 0;
}

.candidate-card__copy strong,
.candidate-card__copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-card__copy strong {
  color: var(--ink);
  font-size: 12px;
}

.candidate-card__copy small {
  margin-top: 3px;
  color: #9ba5af;
  font-size: 9px;
}

.candidate-card__copy small a,
.stop-note a,
.inline-note-link {
  color: #2d6da9;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.candidate-card__copy small a:hover,
.stop-note a:hover,
.inline-note-link:hover {
  color: var(--blue-deep);
}

.candidate-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.candidate-add,
.candidate-open {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  place-items: center;
  color: var(--blue);
  background: var(--blue-pale);
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
}

.candidate-open {
  color: #8996a5;
  background: transparent;
}

.candidate-open svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.add-stop-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed #bdc8d4;
  border-radius: 16px;
  text-align: left;
  background: rgba(248, 250, 251, 0.7);
  cursor: pointer;
}

.add-stop-button:hover {
  border-color: var(--blue);
  background: #f3f7fb;
}

.add-stop-button__plus {
  display: grid;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  place-items: center;
  color: var(--blue);
  background: #e6eef9;
  font-size: 20px;
  font-weight: 400;
}

.add-stop-button strong,
.add-stop-button small {
  display: block;
}

.add-stop-button strong {
  color: #536982;
  font-size: 11px;
}

.add-stop-button small {
  margin-top: 3px;
  color: #98a2ad;
  font-size: 9px;
}

.local-note {
  margin: 13px 8px 0;
  color: #a0a8b1;
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
}

.map-status {
  position: absolute;
  z-index: 10;
  bottom: 22px;
  left: 476px;
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  color: #6e7b86;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  font-size: 10px;
  backdrop-filter: blur(12px);
}

.map-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(215, 155, 53, 0.13);
}

.map-status.is-live .map-status__dot {
  background: #42a974;
  box-shadow: 0 0 0 4px rgba(66, 169, 116, 0.13);
}

.map-status.is-offline .map-status__dot {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(239, 115, 95, 0.14);
}

.map-retry-button {
  position: absolute;
  z-index: 15;
  top: 50%;
  left: calc(50% + 216px);
  display: inline-flex;
  height: 42px;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid #d9e1e8;
  border-radius: 13px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.map-retry-button:hover {
  border-color: #b6c9de;
  background: #fff;
}

.map-controls {
  position: absolute;
  z-index: 10;
  right: 22px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.map-control {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(229, 231, 228, 0.9);
  place-items: center;
  color: #5d6e80;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 20px;
  backdrop-filter: blur(12px);
}

.map-control:first-child {
  border-radius: 14px;
}

.map-controls > .map-control {
  border-radius: 14px;
}

.map-control.is-active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.map-control svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.zoom-control {
  display: grid;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.zoom-control .map-control {
  border: 0;
  border-bottom: 1px solid #e9ebe8;
  border-radius: 0;
  box-shadow: none;
}

.zoom-control .map-control:last-child {
  border-bottom: 0;
}

.zoom-control span {
  height: 1px;
  background: #e9ebe8;
}

.map-attribution {
  position: absolute;
  z-index: 8;
  right: 18px;
  bottom: 7px;
  color: rgba(82, 91, 90, 0.58);
  font-size: 9px;
}

.mobile-panel-toggle {
  display: none;
}

.sheet-backdrop {
  position: fixed;
  z-index: 45;
  inset: 0;
  background: rgba(24, 35, 44, 0.18);
  backdrop-filter: blur(2px);
}

.bottom-sheet {
  position: fixed;
  z-index: 50;
  right: 50%;
  bottom: 18px;
  width: min(560px, calc(100vw - 28px));
  padding: 24px 24px 21px;
  border: 1px solid #e7e5df;
  border-radius: 27px;
  background: #fff;
  box-shadow: 0 25px 80px rgba(28, 38, 46, 0.22);
  transform: translateX(50%);
}

.sheet-grip {
  width: 38px;
  height: 4px;
  margin: -12px auto 16px;
  border-radius: 4px;
  background: #dfe3e5;
}

.sheet-close,
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  place-items: center;
  color: #83909e;
  background: #f1f3f4;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.bottom-sheet h2,
.modal__card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.mode-route-pair {
  margin: 8px 40px 19px 0;
  overflow: hidden;
  color: #718197;
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mode-option {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 9px 13px;
  border: 1px solid #e5e9ec;
  border-radius: 16px;
  text-align: left;
  background: #f8fafb;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.mode-option:hover {
  border-color: #bfcfdf;
  background: #f4f8fb;
}

.mode-option.is-selected {
  border-color: var(--blue);
  background: #edf3fa;
  box-shadow: inset 0 0 0 1px var(--blue);
}

.mode-option.is-loading {
  cursor: wait;
  opacity: 0.7;
}

.mode-option__icon {
  display: grid;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  place-items: center;
  color: var(--blue);
  background: #fff;
  font-size: 19px;
}

.mode-option strong,
.mode-option small {
  display: block;
}

.mode-option strong {
  color: #5d7188;
  font-size: 12px;
}

.mode-option small {
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.mode-sheet-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eeefec;
}

.mode-sheet-footer > span {
  flex: 1;
  color: #98a3ad;
  font-size: 9px;
}

.navigate-button,
.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  padding: 0 17px;
  border-radius: 13px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.navigate-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
}

.navigate-button:hover,
.primary-button:hover {
  background: var(--blue-deep);
}

.navigate-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.modal {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  padding: 22px;
  place-items: center;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(24, 34, 44, 0.28);
  backdrop-filter: blur(4px);
}

.modal__card {
  position: relative;
  z-index: 1;
  width: min(600px, 100%);
  max-height: min(86vh, 820px);
  overflow-y: auto;
  padding: 27px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 30px 100px rgba(20, 31, 40, 0.28);
}

.modal__card--share {
  width: min(650px, 100%);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}

.modal__header > div {
  min-width: 0;
}

.item-form {
  display: grid;
  gap: 15px;
}

.item-form label {
  display: grid;
  gap: 7px;
  color: #62758b;
  font-size: 11px;
  font-weight: 700;
}

.item-form input,
.item-form select,
.item-form textarea {
  width: 100%;
  border: 1px solid #e1e5e7;
  border-radius: 12px;
  color: var(--ink);
  background: #fbfcfc;
  font-size: 13px;
  outline: 0;
}

.transport-fields {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid #e4e9ec;
  border-radius: 16px;
  background: #f8fafb;
}

.transport-fields[hidden] {
  display: none;
}

.form-hint {
  margin: 0;
  color: #8d99a6;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.55;
}

.modal-place-results {
  overflow: hidden;
  border: 1px solid #dfe5e8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(30, 44, 57, 0.14);
}

.modal-place-result {
  display: grid;
  width: 100%;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid #eef0ee;
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.modal-place-result:last-child {
  border-bottom: 0;
}

.modal-place-result:hover {
  background: #f7fafc;
}

.modal-place-result__icon {
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  place-items: center;
  color: var(--result-color);
  background: color-mix(in srgb, var(--result-color) 12%, white);
  font-size: 17px;
}

.modal-place-result__copy {
  min-width: 0;
}

.modal-place-result__copy strong,
.modal-place-result__copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-place-result__copy strong {
  color: var(--ink);
  font-size: 12px;
}

.modal-place-result__copy small {
  margin-top: 3px;
  color: #8d99a6;
  font-size: 9px;
}

.modal-place-result__pick {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.modal-place-empty {
  padding: 14px;
  color: #8c98a4;
  text-align: center;
  font-size: 10px;
}

.icon-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.icon-fieldset legend {
  padding: 0;
  color: #62758b;
  font-size: 11px;
  font-weight: 700;
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 7px;
  max-height: 238px;
  margin-top: 7px;
  padding: 9px;
  overflow-y: auto;
  border: 1px solid #e1e5e7;
  border-radius: 14px;
  background: #fbfcfc;
  scrollbar-width: thin;
}

.icon-choice {
  display: grid;
  min-height: 57px;
  padding: 6px 4px;
  border: 1px solid #e8eaeb;
  border-radius: 11px;
  place-items: center;
  color: #6f7d8b;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.icon-choice:hover {
  border-color: var(--icon-color);
  background: color-mix(in srgb, var(--icon-color) 5%, white);
}

.icon-choice.is-selected {
  border-color: var(--icon-color);
  background: color-mix(in srgb, var(--icon-color) 10%, white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--icon-color) 14%, transparent);
}

.icon-choice > span {
  font-size: 20px;
  line-height: 1;
}

.icon-choice small {
  overflow: hidden;
  max-width: 100%;
  color: #6e7b88;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-form input,
.item-form select {
  height: 44px;
  padding: 0 12px;
}

.item-form textarea {
  min-height: 84px;
  padding: 11px 12px;
  resize: vertical;
}

.item-form input:focus,
.item-form select:focus,
.item-form textarea:focus {
  border-color: #9fb8d4;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(40, 81, 138, 0.08);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 7px;
}

.form-spacer {
  flex: 1;
}

.secondary-button {
  border: 1px solid #dfe3e5;
  color: #65788e;
  background: #f6f8f9;
}

.danger-button {
  border: 1px solid #f0d3ce;
  color: #c66050;
  background: #fff5f2;
}

.share-copy {
  margin: 0 0 18px;
  color: #6f7f90;
  font-size: 12px;
  line-height: 1.7;
}

.cloud-share-panel {
  display: grid;
  gap: 13px;
  padding: 18px;
  border: 1px solid #dfe6ec;
  border-radius: 18px;
  background: linear-gradient(135deg, #f5f8fc, #fbfcfd);
}

.cloud-share-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.cloud-share-panel p {
  margin: 6px 0 0;
  color: #748498;
  font-size: 10px;
  line-height: 1.6;
}

.cloud-share-panel > .primary-button {
  width: fit-content;
}

.cloud-share-links {
  display: grid;
  gap: 11px;
}

.cloud-share-links label {
  display: grid;
  gap: 6px;
  color: #62758b;
  font-size: 10px;
  font-weight: 800;
}

.cloud-share-links .share-link-box {
  align-items: center;
}

.cloud-share-links .secondary-button {
  flex: 0 0 auto;
  min-height: 40px;
}

.cloud-share-regenerate {
  width: fit-content;
  padding: 2px 0;
  border: 0;
  color: #6a7f96;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

.cloud-share-regenerate:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.share-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
  color: #9aa4ae;
  font-size: 9px;
}

.share-divider::before,
.share-divider::after {
  height: 1px;
  flex: 1;
  background: #eceeea;
  content: "";
}

.share-options {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 14px;
  border: 1px solid #e7e9e7;
  border-radius: 14px;
  background: #fafbfa;
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row strong {
  color: #5a6e85;
  font-size: 12px;
}

.switch-row small {
  margin-top: 3px;
  color: #98a2ac;
  font-size: 9px;
}

.switch-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
}

.share-link-box {
  display: flex;
  gap: 8px;
  padding: 7px;
  border: 1px solid #e2e6e8;
  border-radius: 15px;
  background: #f8fafa;
}

.share-link-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: #63758b;
  background: transparent;
  font-size: 11px;
}

.share-link-box .primary-button {
  flex: 0 0 auto;
  min-height: 40px;
}

.share-warning {
  margin: 12px 3px 0;
  color: #9aa3ad;
  font-size: 9px;
  line-height: 1.55;
}

.help-content {
  color: #64778c;
  font-size: 12px;
  line-height: 1.75;
}

.help-content ol {
  margin: 12px 0;
  padding-left: 20px;
}

.help-content code {
  padding: 2px 5px;
  border-radius: 5px;
  color: #415b79;
  background: #eef3f7;
  font-family: Consolas, monospace;
  font-size: 11px;
}

.help-note {
  padding: 12px 14px;
  border-radius: 13px;
  background: #f4f7fa;
}

.offline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 13px 0;
}

.offline-actions .secondary-button {
  flex: 1;
  min-width: 150px;
}

.toast {
  position: fixed;
  z-index: 100;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  padding: 11px 17px;
  border-radius: 12px;
  color: #fff;
  background: rgba(24, 46, 75, 0.94);
  box-shadow: 0 12px 32px rgba(17, 34, 52, 0.22);
  font-size: 12px;
  transform: translateX(-50%);
  animation: toast-in 0.22s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

.share-view .edit-only,
.share-view .mobile-panel-toggle,
.share-view .panel-collapse {
  display: none !important;
}

.share-view .itinerary-panel {
  top: calc(max(16px, env(safe-area-inset-top)) + 66px);
}

.share-view .stop-card,
.share-view .leg-button,
.share-view .candidate-add {
  cursor: default;
}

.share-view .status-toggle,
.share-view .open-stop,
.share-view .candidate-actions {
  display: none;
}

.share-view .stop-card {
  grid-template-columns: 50px 1fr;
}

body.panel-hidden .topbar {
  left: 20px;
}

@media (min-width: 821px) {
  body.panel-hidden .mobile-panel-toggle {
    position: absolute;
    z-index: 10;
    right: auto;
    bottom: 24px;
    left: 22px;
    display: flex;
    height: 46px;
    align-items: center;
    gap: 8px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.84);
    border-radius: 15px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    transform: none;
    backdrop-filter: blur(14px);
  }

  body.panel-hidden .mobile-panel-toggle__grip {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--coral);
  }
}

@media (max-width: 1060px) {
  .topbar {
    grid-template-columns: auto minmax(220px, 1fr) auto;
  }

  .itinerary-panel {
    width: min(400px, calc(100vw - 34px));
  }

  .map-status {
    left: 426px;
  }
}

@media (max-width: 820px) {
  :root {
    --radius-xl: 24px;
  }

  .topbar {
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    left: 10px;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .brand {
    width: 48px;
    min-width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 16px;
  }

  .brand > span:last-child,
  .place-search kbd,
  .icon-button {
    display: none;
  }

  .brand__mark {
    width: 30px;
    height: 30px;
  }

  .place-search {
    height: 48px;
    border-radius: 16px;
  }

  .place-search__icon {
    width: 42px;
    flex-basis: 42px;
  }

  .share-button {
    width: 48px;
    height: 48px;
    justify-content: center;
    padding: 0;
    border-radius: 16px;
  }

  .share-button span {
    display: none;
  }

  .itinerary-panel {
    top: auto;
    right: 8px;
    bottom: 0;
    left: 8px;
    width: auto;
    height: min(58dvh, 610px);
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 24px 24px 0 0;
    transform: translateY(0);
  }

  .map-canvas {
    left: 0;
  }

  .itinerary-panel.is-collapsed {
    opacity: 0;
    transform: translateY(calc(100% + 20px));
  }

  .trip-heading {
    padding: 19px 19px 10px;
  }

  .trip-heading h1 {
    font-size: 22px;
  }

  .panel-collapse {
    top: 15px;
    right: auto;
    left: 50%;
    width: 42px;
    height: 15px;
    border-radius: 8px;
    background: transparent;
    transform: translateX(-50%);
  }

  .panel-collapse svg {
    display: none;
  }

  .panel-collapse::before {
    width: 36px;
    height: 4px;
    border-radius: 4px;
    background: #d8dcdf;
    content: "";
  }

  .trip-edit {
    margin-right: 0;
  }

  .day-tabs {
    padding: 0 19px 11px;
  }

  .day-context {
    padding: 0 19px 10px;
  }

  .route-summary {
    margin-right: 14px;
    margin-left: 14px;
  }

  .timeline-scroll {
    padding: 7px 14px 22px;
  }

  .mobile-panel-toggle {
    position: absolute;
    z-index: 10;
    right: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    height: 44px;
    align-items: center;
    gap: 7px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    transform: translateX(50%);
    backdrop-filter: blur(14px);
  }

  .mobile-panel-toggle.is-hidden {
    display: none;
  }

  .map-status {
    display: none;
  }

  .map-status.is-offline {
    top: calc(max(10px, env(safe-area-inset-top)) + 58px);
    bottom: auto;
    left: 10px;
    display: flex;
    width: fit-content;
    max-width: calc(100vw - 70px);
  }

  .map-retry-button {
    top: 34%;
    left: 50%;
  }

  .map-controls {
    top: calc(max(10px, env(safe-area-inset-top)) + 58px);
    right: 10px;
    bottom: auto;
    display: flex;
  }

  .map-controls .map-control {
    width: 38px;
    height: 38px;
  }

  .map-attribution {
    right: 10px;
    bottom: 63px;
  }

  .bottom-sheet {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
    border-radius: 25px 25px 0 0;
    transform: none;
  }

  .mode-grid {
    gap: 8px;
  }

  .mode-option {
    min-height: 60px;
    padding: 8px 9px;
  }

  .mode-option__icon {
    width: 36px;
    height: 36px;
  }

  .modal {
    align-items: end;
    padding: 0;
  }

  .modal__card {
    width: 100%;
    max-height: 92dvh;
    padding: 23px 18px calc(18px + env(safe-area-inset-bottom));
    border-radius: 25px 25px 0 0;
  }

  .form-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .share-link-box {
    display: grid;
  }

  .share-link-box .primary-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .itinerary-panel {
    height: min(61dvh, 620px);
  }

  .stop-card {
    grid-template-columns: 45px 1fr 18px;
    gap: 8px;
  }

  .stop-icon {
    width: 42px;
    height: 42px;
  }

  .leg-row {
    padding-left: 28px;
  }

  .leg-row::before {
    left: 28px;
  }

  .leg-button {
    gap: 5px;
    padding-right: 10px;
    padding-left: 8px;
  }

  .leg-button__distance {
    display: none;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .mode-option {
    grid-template-columns: 38px 1fr;
  }

  .mode-sheet-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .navigate-button {
    width: 100%;
  }

  .form-grid--two {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
