:root {
  --ink: #15211d;
  --muted: #68766f;
  --paper: rgba(250, 252, 248, 0.94);
  --panel: rgba(255, 255, 255, 0.96);
  --line: rgba(21, 33, 29, 0.16);
  --accent: #087f5b;
  --accent-strong: #0b5d56;
  --accent-soft: #d9f3ef;
  --drive: #087f5b;
  --ride: #f97316;
  --ferry: #0284c7;
  --optional: #d946ef;
  --alternate: #d97706;
  --end: #dc2626;
  --shadow: 0 24px 78px rgba(16, 32, 28, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(135deg, #dce9e1 0%, #eef3eb 42%, #d8ecec 100%);
}

button {
  font: inherit;
}

button {
  cursor: pointer;
}

.travel-app {
  position: relative;
  width: 100%;
  height: 100%;
}

.map-stage,
.world-map {
  position: absolute;
  inset: 0;
}

.world-map {
  background: #e8eee9;
}

.map-brand {
  position: absolute;
  z-index: 9;
  left: 18px;
  top: 18px;
  display: grid;
  gap: 3px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.map-brand span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.map-brand strong {
  font-size: 18px;
  line-height: 1.2;
}

.mode-switch {
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.mode-button {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.mode-button.is-active {
  background: var(--accent);
  color: #fff;
}

.primary-button,
.secondary-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.secondary-button {
  background: #fff;
  color: var(--ink);
}

.side-panel {
  position: absolute;
  z-index: 10;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(380px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-head {
  flex: none;
}

.panel-head span {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
}

.panel-head h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.18;
}

.panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.trip-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  align-content: start;
}

.trip-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.trip-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(8, 127, 91, 0.15);
}

.trip-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
}

.trip-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trip-icon {
  font-size: 24px;
}

.trip-info h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.trip-info p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.trip-open {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.trip-add {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.72);
}

.trip-add .trip-cover {
  background: #fff;
  border: 1px dashed var(--accent);
}

.trip-add-icon {
  font-size: 28px;
  font-weight: 300;
  color: var(--accent);
}

.trip-add:hover {
  background: rgba(8, 127, 91, 0.06);
  border-color: var(--accent);
}

.empty-state {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.empty-state.is-error {
  color: #b91c1c;
}

.travel-pin {
  width: 40px;
  height: 40px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.pin-label {
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* detail page */
.detail-app {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 40%);
}

.detail-left {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  min-width: 0;
  min-height: 0;
}

.detail-right {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
}

.detail-map-stage {
  height: 100%;
  min-height: 0;
}

.detail-header {
  position: absolute;
  z-index: 9;
  top: 60px;
  left: 16px;
  width: 300px;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.map-float {
  position: fixed;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(16, 32, 28, 0.16);
  backdrop-filter: blur(18px);
  font-size: 12px;
  font-weight: 800;
}

.back-link {
  top: 16px;
  left: 16px;
  color: var(--accent);
  text-decoration: none;
}

.edit-toggle {
  top: 16px;
  right: 16px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.detail-hero h1 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.25;
}

.detail-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.day-selector {
  position: absolute;
  z-index: 9;
  top: 156px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100% - 220px);
  overflow-y: auto;
}

.day-selector:empty {
  display: none;
}

.day-chip {
  min-width: 72px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 6px 18px rgba(16, 32, 28, 0.14);
  backdrop-filter: blur(18px);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.day-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.route-legend {
  position: absolute;
  z-index: 9;
  top: 60px;
  right: 16px;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 22px rgba(16, 32, 28, 0.16);
  backdrop-filter: blur(18px);
  font-size: 11px;
  font-weight: 700;
}

.route-legend:empty {
  display: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.legend-swatch {
  width: 22px;
  height: 0;
  border-top: 4px solid var(--drive);
  border-radius: 2px;
}

.legend-swatch.is-dashed {
  border-top-style: dashed;
  border-top-width: 3px;
}

.detail-map-stage {
  position: relative;
  width: 100%;
  background: #e8eee9;
}

.detail-map {
  position: absolute;
  inset: 0;
  background: #e8eee9;
}

.detail-body {
  position: relative;
  padding: 20px;
  border-left: 1px solid var(--line);
  background: #fff;
  overflow-y: auto;
}

.detail-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding-right: 84px;
}

.detail-tab {
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);  font-size: 13px;
  font-weight: 800;
}

.detail-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.tab-icon {
  display: none;
}

.detail-panel {
  display: none;
}

.detail-panel.is-active {
  display: block;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 720px;
}

.timeline-day {
  max-width: 720px;
  margin-bottom: 8px;
  scroll-margin-top: 12px;
}

.timeline-day.is-day-hidden {
  display: none;
}

.timeline-day-title {
  position: sticky;
  top: 8px;
  z-index: 5;
  margin: 18px 0 4px;
  padding: 4px 12px;
  display: inline-block;
  border-radius: 999px;
  background: rgba(217, 243, 239, 0.92);
  backdrop-filter: blur(8px);
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
}

.timeline-day:first-child .timeline-day-title {
  margin-top: 0;
}

.timeline-day .timeline {
  max-width: none;
}

.timeline li {
  scroll-margin-bottom: 60px;
  padding: 14px 10px;
  margin: 0 -10px;
  border-bottom: 1px solid var(--line);
  border-radius: 6px;
  transition: background 0.15s ease;
}

.timeline li:hover {
  background: rgba(8, 127, 91, 0.05);
}

.timeline-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.timeline-item.no-thumb {
  grid-template-columns: minmax(0, 1fr);
}

.timeline-thumb {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--accent-soft);
}

.timeline li.optional {
  background: linear-gradient(90deg, rgba(217, 70, 239, 0.08), transparent 64%);
}

.timeline li.alternate {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.1), transparent 64%);
}

.timeline time {
  color: var(--alternate);
  font-size: 13px;
  font-weight: 900;
}

.timeline strong,
.timeline small {
  display: block;
}

.timeline strong {
  font-size: 15px;
}

.timeline small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.photo-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--panel);
}

.photo-card img,
.photo-placeholder {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--accent-soft);
}

.photo-card figcaption {
  padding: 10px;
}

.photo-card span {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.photo-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.diary-empty {
  color: var(--muted);
  font-style: italic;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.88);
}

.is-hidden {
  display: none !important;
}

.lightbox.is-hidden {
  display: none;
}

.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 6px;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 24px;
}

.edit-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 40vw);
  height: 100vh;
  flex-direction: column;
  padding: 20px;
  border-left: 1px solid var(--line);
  background: var(--paper);
  overflow-y: auto;
  z-index: 100;
}

.edit-drawer.is-open {
  display: flex;
}

@media (max-width: 860px) {
  .edit-drawer {
    width: 100vw;
  }
}

.edit-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.edit-drawer-head h2 {
  margin: 0;
  font-size: 18px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 18px;
}

.edit-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.edit-form fieldset {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.edit-form legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 900;
  color: var(--accent);
}

.edit-form label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.edit-form input,
.edit-form select,
.edit-form textarea {
  width: 100%;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 13px;
}

.form-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-row input,
.form-row select {
  flex: 1;
  min-width: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 10px;
}

.form-grid label {
  margin-bottom: 0;
}

.form-block-button {
  width: 100%;
}

.form-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.edit-photos-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.edit-photos-empty {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

.edit-photo-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.edit-photo-card img,
.edit-photo-placeholder {
  width: 100%;
  height: 90px;
  object-fit: cover;
  background: var(--accent-soft);
}

.edit-photo-card figcaption {
  padding: 6px 8px;
}

.edit-photo-card span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-photo-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .edit-photos-list {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

.edit-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.edit-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.edit-list-item small {
  color: var(--muted);
  font-size: 11px;
}

.edit-list-label {
  flex: 1;
  min-width: 0;
}

.edit-list-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.edit-list-item.is-editing {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.map-pos-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.edit-row {
  display: grid;
  gap: 0;
}

.edit-row.is-dragging .edit-list-item {
  opacity: 0.4;
}

.edit-row.drag-over-top .edit-list-item {
  box-shadow: inset 0 2px 0 var(--accent);
}

.edit-row.drag-over-bottom .edit-list-item {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.drag-handle {
  flex-shrink: 0;
  cursor: grab;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  user-select: none;
  touch-action: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.icon-btn.is-active svg {
  fill: currentColor;
}

.icon-btn.is-danger:hover {
  border-color: #b91c1c;
  color: #b91c1c;
}

.inline-editor {
  display: grid;
  gap: 10px;
  margin: 6px 0 2px;
  padding: 12px;
  border: 1px solid var(--accent);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
}

.inline-editor .form-grid {
  margin-bottom: 8px;
}

.inline-editor label {
  margin-bottom: 0;
}

.inline-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.place-image-field {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.place-image-title {
  display: block;
  margin-bottom: 5px;
}

.place-image-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.place-image-preview {
  display: flex;
  gap: 6px;
}

.place-image-preview img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--accent-soft);
  cursor: pointer;
}

.place-image-preview img.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(8, 127, 91, 0.25);
}

.place-image-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.edit-add-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.edit-add-row:hover {
  border-color: var(--accent);
  background: rgba(8, 127, 91, 0.06);
}

.edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

.edit-danger {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.edit-danger .danger-button {
  width: 100%;
}

.danger-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #b91c1c;
  border-radius: 6px;
  background: #fff;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 800;
}

.danger-button:hover {
  background: #b91c1c;
  color: #fff;
}

.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(16, 32, 28, 0.46);
}

.confirm-dialog-card {
  width: min(420px, calc(100vw - 40px));
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.confirm-dialog-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.confirm-dialog-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  word-break: keep-all;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 720px;
}

.plain-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.plain-list strong,
.plain-list small {
  display: block;
}

.plain-list strong {
  font-size: 14px;
}

.plain-list small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

/* route markers / labels reused from trip-route-map */
.route-marker {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--drive);
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  font-size: 12px;
  font-weight: 900;
}

.route-marker.ride {
  background: var(--ride);
}

.route-marker.ferry {
  background: var(--ferry);
}

.route-marker.optional {
  background: var(--optional);
}

.route-marker.alternate {
  background: var(--alternate);
}

.route-marker.end {
  background: var(--end);
}

.route-pin {
  position: relative;
  width: 30px;
  height: 30px;
}

.route-pin .place-card {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  width: 150px;
  z-index: 2;
  border: 1px solid rgba(21, 33, 29, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  pointer-events: none;
}

.route-pin:hover .place-card {
  display: block;
}

.place-card-img {
  display: block;
  width: 100%;
  height: 84px;
  object-fit: cover;
  background: var(--accent-soft);
}

.place-card-name {
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segment-label {
  display: block;
  min-width: 86px;
  padding: 5px 8px;
  border: 1px solid rgba(21, 33, 29, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.amap-copyright,
.amap-logo {
  opacity: 0.72;
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .travel-app {
    display: grid;
    grid-template-rows: 55vh auto;
    height: auto;
    min-height: 100vh;
  }

  .map-stage {
    position: relative;
    min-height: 55vh;
  }

  .world-map {
    position: absolute;
    inset: 0;
  }

  .side-panel {
    position: relative;
    inset: auto;
    width: auto;
    min-height: 45vh;
    margin: 10px;
  }

  .map-brand {
    left: 10px;
    right: 10px;
    top: 10px;
    max-width: none;
  }

  .mode-switch {
    top: auto;
    bottom: 10px;
    left: 10px;
    transform: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .detail-app {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  .detail-left {
    position: relative;
    display: block;
  }

  .detail-map-stage {
    height: 56vh;
  }

  .day-selector {
    top: auto;
    bottom: 10px;
    left: 10px;
    right: 10px;
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .day-selector::-webkit-scrollbar {
    display: none;
  }

  .day-chip {
    flex-shrink: 0;
    min-width: 0;
  }

  .route-legend {
    display: none;
  }

  .detail-tabs {
    position: fixed;
    z-index: 80;
    left: 0;
    right: 0;
    bottom: 0;
    gap: 0;
    margin-bottom: 0;
    padding: 2px 4px calc(2px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--paper);
    backdrop-filter: blur(18px);
  }

  .detail-tab {
    flex: 1;
    min-height: 36px;
    padding: 0 4px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 19px;
  }

  .detail-tab .tab-label {
    display: none;
  }

  .detail-tab .tab-icon {
    display: inline;
  }

  .detail-tab.is-active {
    background: var(--accent);
    color: #fff;
  }

  .edit-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(520px, 100vw);
    height: auto;
    z-index: 90;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    visibility: hidden;
    box-shadow: var(--shadow);
  }

  .edit-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
  }

  .detail-header {
    position: absolute;
    z-index: 10;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 8px 10px;
  }

  .detail-hero {
    flex: 1;
    min-width: 0;
  }

  .header-actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
  }

  .header-actions .map-float {
    position: static;
    min-height: 30px;
    padding: 0 10px;
    box-shadow: none;
  }

  .detail-hero h1 {
    font-size: 20px;
  }

  .detail-body {
    padding: 12px 16px calc(56px + env(safe-area-inset-bottom));
    border-left: 0;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.sync-status { display: block; margin: 8px 0; font-size: 12px; color: #53675b; max-width: 260px; }
.account-dialog { width: min(440px, calc(100vw - 32px)); max-height: 90vh; overflow: auto; border: 1px solid #d1ded5; border-radius: 16px; padding: 24px; color: #233e30; box-shadow: 0 16px 70px #12332533; }
.account-dialog::backdrop { background: #102b2466; }
.account-dialog label { display: block; margin: 12px 0; }
.account-dialog input { display: block; box-sizing: border-box; width: 100%; padding: 10px; margin-top: 6px; border: 1px solid #b9cdc0; border-radius: 8px; font: inherit; }
.account-dialog button { margin: 4px 4px 4px 0; }
[hidden] { display: none !important; }
.account-close { float: right; }
.account-trigger { font-size: 12px; }
/* Journey home: editorial travel cards, isolated from the trip editor. */
.journey-home{overflow:auto;background:#f7f6f2;color:#243b33}
.journey-home .travel-app{max-width:1120px;height:auto;margin:auto;padding:48px 32px 110px;display:flex;flex-direction:column;gap:36px}
.journey-heading span,.feature-label{font-size:11px;letter-spacing:2px;color:#67786d}
.journey-heading h1{font-family:Georgia,'Songti SC',serif;font-size:clamp(30px,5vw,48px);font-weight:500;margin:18px 0 12px}
.journey-heading p{color:#7a827b;font-size:14px}
.featured-trip{display:grid;grid-template-columns:1.2fr 1fr;overflow:hidden;border-radius:24px;background:#e7ece2;min-height:290px}
.feature-copy{padding:40px}.feature-copy h2{font-size:30px;font-weight:500;line-height:1.5;margin:20px 0 10px}.feature-copy p{color:#637368;line-height:1.8}.feature-copy button{margin-top:20px;border-radius:24px;padding:12px 24px;min-height:48px}
.feature-art{display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse at 95% 100%,#6d8873 0 35%,transparent 35.5%),radial-gradient(ellipse at 25% 110%,#a5b69c 0 60%,transparent 60.5%),#d4dfcc}.feature-art span{font-family:Georgia,'Songti SC',serif;line-height:1.8;letter-spacing:8px;color:#fff;font-size:28px}
.journey-home .side-panel{order:1;position:static;width:100%;padding:0;margin:0;background:none;border:0;box-shadow:none;backdrop-filter:none;min-height:0;gap:20px}
.journey-home .panel-head>span{display:none}.journey-home .panel-head h1{font-size:24px;font-weight:500}
.journey-home .mode-switch{position:static;transform:none;align-self:flex-start;background:#eaece6;box-shadow:none;border:0;border-radius:24px;padding:4px}.journey-home .mode-button{border-radius:20px;font-weight:500}
.journey-home .trip-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible;gap:22px}
.journey-home .trip-card{display:flex;flex-direction:column;align-items:stretch;padding:0;overflow:hidden;border:0;border-radius:18px;background:#fff;gap:0;transition:transform .2s}
.journey-home .trip-card:hover{transform:translateY(-3px)}.journey-home .trip-cover{width:100%;height:180px;border-radius:0;background:#e2e8dd;display:grid;place-items:center}.journey-home .trip-cover img{width:100%;height:100%;object-fit:cover}.journey-home .trip-info{padding:20px}.journey-home .trip-info h3{font-size:19px;font-weight:500}.journey-home .trip-open{margin:0 20px 20px;align-self:flex-start}.journey-home .trip-add{border:1px dashed #b8c7b8;background:transparent}.journey-home #restoreTrip{grid-column:1/-1;justify-self:end}
.journey-home .map-stage{order:2;position:relative;min-height:300px;height:340px;overflow:hidden;border-radius:24px}.journey-home .map-brand{box-shadow:none;border:0}.journey-nav{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);display:flex;gap:8px;padding:8px;background:#243b33;border-radius:36px;z-index:20;box-shadow:0 8px 24px #243b3320}.journey-nav a{color:white;text-decoration:none;padding:12px 38px;border-radius:24px}.journey-nav a:hover{background:#ffffff20}
@media(max-width:700px){.journey-home .travel-app{padding:30px 20px 110px;gap:28px}.featured-trip{grid-template-columns:1fr;min-height:0}.feature-copy{padding:28px}.feature-copy h2{font-size:26px}.feature-art{height:110px}.feature-art span{font-size:18px;line-height:1.4}.journey-home .trip-list{grid-template-columns:1fr 1fr;gap:12px}.journey-home .trip-cover{height:140px}.journey-home .trip-info{padding:14px}.journey-home .trip-info h3{font-size:16px}.journey-home .trip-info p{font-size:11px}.journey-home .map-stage{min-height:280px;height:280px}.journey-nav{bottom:max(12px,env(safe-area-inset-bottom))}}
@media(prefers-reduced-motion:reduce){.journey-home .trip-card{transition:none}}

/* Account tools belong to personal settings, outside the travel content. */
.journey-nav .account-trigger{border:0;background:transparent;color:#fff;padding:12px 28px;margin:0;border-radius:24px;font-size:16px;font-weight:400;min-height:44px;white-space:nowrap}
.journey-nav a{padding:12px 28px;white-space:nowrap}
.journey-nav .account-trigger:hover{background:#ffffff20}
.journey-nav :focus-visible{outline:2px solid #e1d6a8;outline-offset:2px}
.account-dialog .sync-status{display:block;margin:8px 0 16px}

[hidden]{display:none!important}
.account-dialog{width:min(500px,calc(100vw - 28px))}
.account-dialog h3{font-size:18px;margin:0 0 8px;color:#243b33}
.account-dialog h4{font-size:14px;margin:24px 0 12px}
.visitor-controls,.share-manager{margin:22px 0;padding:22px 0;border-top:1px solid #e2e6dc}
.visitor-controls>p,.share-manager>p,.share-feedback{font-size:13px;color:#68766f;line-height:1.7;overflow-wrap:anywhere}
.share-manager select{display:block;width:100%;padding:11px;margin-top:6px;border:1px solid #b9cdc0;border-radius:8px;background:#fff;color:#243b33;font:inherit}
.account-dialog .share-trip-options{border:1px solid #d9e0d4;border-radius:10px;margin:16px 0;padding:12px;max-height:220px;overflow:auto}
.account-dialog .share-trip-options label{display:flex;align-items:center;gap:10px;font-size:14px;line-height:1.6;margin:8px 0}
.account-dialog .share-trip-options input{width:18px;height:18px;margin:0;flex:none;accent-color:#087f5b}
.share-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;border-bottom:1px solid #e5e8e0}
.share-item strong{font-size:14px;font-weight:600;overflow-wrap:anywhere}
.share-item small{display:block;font-size:12px;color:#6e7b71;line-height:1.6;margin-top:5px}
.share-result{padding:12px;background:#eef3e9;border-radius:12px;margin:18px 0}
.share-result input{font-size:12px}
.owner-unlock{border-top:1px solid #e2e6dc;padding-top:12px;margin-top:18px}
html[data-access=guest] .journey-nav a[href="#footprints"]{display:none}
/* One quiet entry; the conversation has its own page. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.ai-entry{display:flex;align-items:center;border:1px solid #cbd6c7;border-radius:32px;background:#fffdf7;min-height:58px;max-width:780px;width:100%;margin-top:-10px}
.ai-entry-link{display:flex;align-items:center;gap:14px;flex:1;min-width:0;padding:16px 20px;text-decoration:none;color:#75816b;font-size:15px;line-height:1.6}
.ai-entry-link span:first-child{font-size:24px;color:#487054}.ai-entry-link span:nth-child(2){flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ai-entry-link span:last-child{color:#456b4d}
.ai-entry button{border:0;background:none;display:grid;place-items:center;min-width:52px;min-height:44px;margin-right:6px;color:#315b45;border-left:1px solid #e6e9dd}
.ai-entry svg,.chat-footer svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
.ai-entry button[aria-pressed=true]{color:#a44d3a}.ai-entry:focus-within{outline:2px solid #799779;outline-offset:3px}
.ai-settings{margin:22px 0;padding:22px 0;border-top:1px solid #e2e6dc}.ai-settings>p,.ai-settings [role=status]{font-size:13px;line-height:1.7;color:#68766f}.ai-settings select{display:block;width:100%;padding:11px;margin-top:6px;border:1px solid #b9cdc0;border-radius:8px;background:#fff;color:#243b33;font:inherit}
.chat-body{overflow:hidden;background:#f7f6f2;color:#243b33}.chat-app{display:flex;flex-direction:column;width:100%;height:var(--chat-height,100dvh);overflow:hidden}
.chat-header{display:flex;align-items:center;gap:12px;padding:14px max(20px,calc((100vw - 960px)/2));border-bottom:1px solid #e4e7dc;background:#f7f6f2;flex:none}
.chat-header h1{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:17px;font-weight:500;margin:0}
.chat-back{font-size:23px;color:#31563d;text-decoration:none;min-width:32px;min-height:40px;display:grid;place-items:center}
.chat-header>button,.chat-header .account-trigger{white-space:nowrap;min-height:38px;padding:6px 10px;background:none;border:1px solid #dce1d3;border-radius:20px;font-size:12px;color:#52644c;font-weight:400}
.chat-header .header-actions{display:flex;gap:0;flex:none}.chat-header button:hover{background:#eaf0e3}
.chat-stream{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scroll-behavior:auto;padding:28px max(22px,calc((100vw - 820px)/2));scrollbar-gutter:stable}
.chat-welcome{padding:clamp(40px,10vh,100px) 0;color:#63785b;max-width:520px;margin:auto;text-align:center}.chat-welcome>span{font-size:40px;color:#54805b}.chat-welcome h2{font-family:Georgia,'Songti SC',serif;font-size:30px;font-weight:500;color:#294834;line-height:1.6}.chat-welcome p{font-size:14px;line-height:1.9}
.chat-message{max-width:100%;margin:0 0 28px;line-height:1.9;font-size:15px;overflow-wrap:anywhere}
.chat-message-text{white-space:pre-wrap}.chat-message.user{margin-left:auto;max-width:85%;width:fit-content;padding:13px 19px;border-radius:22px 22px 5px 22px;background:#e5eddf;color:#2d4b35}.chat-message.assistant{padding:0 2px}
.chat-message-error,.chat-pending{display:block;font-size:12px;color:#8d6545;margin-top:8px}.chat-pending{color:#7e8b74}
.chat-retry,.chat-older{font-size:12px;border:1px solid #c8d3c0;border-radius:16px;background:transparent;color:#3c6547;padding:5px 13px;min-height:32px;margin-top:10px}.chat-older{display:block;margin:0 auto 24px}
.chat-proposal{border-top:1px solid #d6dfce;border-bottom:1px solid #d6dfce;margin-top:18px;padding:10px 0}.chat-proposal summary{cursor:pointer;padding:10px 2px;color:#31553b;font-weight:500;line-height:1.8}.chat-proposal-body{padding:8px 0 20px;font-size:14px;color:#5f7156}.chat-proposal-body>p{line-height:1.9;margin:10px 0}.chat-proposal-meta,.chat-map-state{font-size:12px;color:#809171}.chat-plan-day{padding:16px 0;border-top:1px solid #e0e7d8;margin-top:12px}.chat-plan-day h3{font-size:15px;font-weight:600;margin:0 0 6px;color:#33513c}.chat-plan-route{font-size:12px;color:#7b8d6c}.chat-plan-day ol{padding-left:20px}.chat-plan-day li{padding:7px 0}.chat-plan-day strong{font-weight:500;color:#35533c}.chat-plan-day li p{margin:4px 0;font-size:13px;line-height:1.8}.chat-plan-note{font-size:12px;color:#839276}.chat-save-plan{border-radius:22px;font-weight:500;margin-top:10px}.chat-open-plan{display:inline-block;color:#2e6245;margin-top:8px;text-decoration:none;padding:8px 0}
.chat-conflict{padding:10px 20px;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;font-size:12px;color:#856543;background:#f1e9d9}.chat-conflict button{border:0;border-bottom:1px solid currentColor;background:none;color:inherit;font-size:12px;padding:5px}
.chat-footer{flex:none;padding:8px max(20px,calc((100vw - 820px)/2)) max(12px,env(safe-area-inset-bottom));background:#f7f6f2}.chat-footer>[role=status]{font-size:12px;line-height:1.6;min-height:18px;margin:0 4px 8px;color:#6e8263;overflow-wrap:anywhere;max-height:58px;overflow:auto}
.chat-footer form{display:flex;align-items:flex-end;gap:10px;padding:10px 12px;border:1px solid #c6d3bd;border-radius:26px;background:#fffef8}.chat-footer textarea{flex:1;min-width:0;max-height:120px;min-height:26px;padding:5px 0;border:0;outline:none;resize:none;line-height:1.7;font:inherit;font-size:15px;color:#284635;background:none;overflow:auto}
.chat-footer button{flex:none;display:grid;place-items:center;min-width:38px;min-height:38px;border:0;border-radius:50%;background:none;color:#376447}.chat-footer #chatSend{background:#284e38;color:#fff;font-size:23px}.chat-footer #chatStop{border-radius:18px;font-size:12px;background:#e8e6da;padding:0 12px}.chat-footer button:disabled{opacity:.45;cursor:default}.chat-footer #chatVoice[aria-pressed=true]{color:#af5543}.chat-footer small{display:block;text-align:center;font-size:10px;color:#9ba390;margin-top:9px}
.chat-history-dialog{border:1px solid #d2dccb;border-radius:20px;background:#fffef9;color:#304c37;padding:22px;width:min(460px,calc(100vw - 30px));max-height:80vh;overflow:auto}.chat-history-dialog::backdrop{background:#173f3555}.chat-history-dialog header{display:flex;align-items:center;justify-content:space-between}.chat-history-dialog h2{font-size:20px;font-weight:500}.chat-history-dialog header button{border:0;background:none;font-size:22px;padding:10px;color:#50664a}.chat-history-item{display:flex;gap:14px;padding:14px 0;border-bottom:1px solid #e2e7db}.chat-history-item button{border:0;background:none;text-align:left;line-height:1.7;color:#3d5b40}.chat-history-open{flex:1;min-width:0;overflow-wrap:anywhere;font-size:14px}.chat-history-delete{font-size:12px;color:#8b7761!important}.chat-history-dialog [role=status]{font-size:13px;line-height:1.7;color:#7b8a70}.chat-history-dialog>button{padding:10px 18px;border:1px solid #ccd8c2;background:none;border-radius:20px;margin-top:15px;color:#496845}
@media(max-width:700px){.ai-entry{min-height:54px}.ai-entry-link{padding:13px 15px;font-size:14px;gap:10px}.chat-header{padding:8px 10px;gap:6px;padding-top:max(8px,env(safe-area-inset-top))}.chat-header h1{font-size:15px}.chat-header>button,.chat-header .account-trigger{padding:6px 8px;font-size:11px;min-height:36px}.chat-back{min-width:26px}.chat-stream{padding:24px 18px}.chat-message{font-size:15px}.chat-message.user{max-width:92%}.chat-footer{padding-left:12px;padding-right:12px}.chat-footer textarea{font-size:16px}.chat-footer form{gap:7px;padding:9px 10px}.chat-welcome h2{font-size:27px}}
