/* Trip planner */

.planner-hero .steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.step-btn {
  appearance: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 1.1rem;
  min-height: 2.75rem;
  border: 2px solid var(--on-indigo-muted);
  border-radius: var(--radius);
  background: transparent;
  color: var(--on-indigo);
  cursor: pointer;
}

.step-btn[aria-selected="true"] {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--ink);
}

.step-btn:focus-visible,
.lang-btn:focus-visible,
.icon-btn:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
}

.lang-btn {
  appearance: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--on-indigo);
  background: transparent;
  border: 1.5px solid var(--on-indigo-muted);
  border-radius: var(--radius);
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

.head-nav a[aria-current="page"] {
  border-bottom: 2px solid var(--signal);
}

#panel {
  padding-top: 1.5rem;
  min-width: 0;
}

.btn.small {
  padding: 0.45rem 0.8rem;
  min-height: 2.25rem;
  font-size: 0.88rem;
}

.btn.is-on {
  border: 2px solid var(--indigo);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mine-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--panel);
  border-left: 5px solid var(--signal);
  margin-bottom: 1rem;
}

.pfilters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.pfilters input,
.pfilters select,
.plan-ctl select {
  width: 100%;
  font: inherit;
  padding: 0.55rem 0.7rem;
  min-height: 2.6rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

#panel .chips {
  margin-bottom: 0.6rem;
}

.chip .tier {
  margin-right: 0.1rem;
}

.count {
  margin: 0.8rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.pcards,
.stops,
.cand-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pcard {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.pcard.in-plan {
  background: rgba(10, 143, 60, 0.13);
}

.status-btns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn.st-wish.is-on { background: #7b2cbf; border-color: #7b2cbf; color: #fff; }
.btn.st-plan.is-on { background: #0a8f3c; border-color: #0a8f3c; color: #fff; }

.pcard.in-list:not(.in-plan) {
  background: rgba(123, 44, 191, 0.11);
}

.pcard-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.pcard h3,
.stop h4 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.pcard h3 .ja,
.stop h4 .ja {
  margin-left: 0.5rem;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--muted);
}

.pcard-meta,
.stop-meta {
  margin: 0.15rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.pcard .desc {
  margin: 0.4rem 0 0;
  font-size: 0.94rem;
  max-width: 62ch;
}

.pcard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
}

.tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.3rem;
  margin-left: 0.4rem;
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 3px;
  border: 1.5px solid var(--indigo);
}

.pcard-head .tier {
  margin-left: 0;
}

.tier-S { background: #e5133b; color: #fff; border-color: #e5133b; }
.tier-A { background: #ff8c00; color: #2b1700; border-color: #ff8c00; }
.tier-B { background: #12a4d9; color: #fff; border-color: #12a4d9; }
.tier-C { background: #9aa5b1; color: #fff; border-color: #9aa5b1; }

.legend .tier-sw {
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #6b7785;
}

/* plan tab */

.plan-ctl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.7rem;
  align-items: end;
  margin-bottom: 1.2rem;
}

.plan-ctl label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.plan-ctl .btn {
  grid-column: 1 / -1;
}

.days {
  display: grid;
  gap: 1.1rem;
}

.day-card {
  border-top: 3px solid var(--ink);
  padding-top: 0.5rem;
}

.day-card.st-full { border-top-color: #b8860b; }
.day-card.st-toomuch { border-top-color: var(--down); }

.day-head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}

.day-head h3 {
  margin: 0;
  font-size: 1.15rem;
  border-bottom: 3px solid var(--indigo);
}

.day-status {
  font-size: 0.85rem;
  font-weight: 700;
}

.st-ok.day-status { color: var(--up); }
.st-full.day-status { color: #8a6500; }
.st-toomuch.day-status { color: var(--down); }

.load-bar {
  display: flex;
  height: 0.7rem;
  margin: 0.5rem 0 0.25rem;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.seg-stay { background: var(--indigo); }
.seg-travel { background: var(--signal); }

.day-totals {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.stop {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: start;
  padding: 0.7rem 0.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: grab;
}

.stop.dragging {
  opacity: 0.4;
}

.stops.drop-on,
.cand-list.drop-on {
  outline: 2px dashed var(--indigo);
  outline-offset: 3px;
}

.stop-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}

.stop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
}

.stop-ctl {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  max-width: 11rem;
}

.stop-ctl select {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.3rem 0.4rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
}

.icon-btn {
  appearance: none;
  width: 2.1rem;
  height: 2.1rem;
  font: inherit;
  font-weight: 800;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.leg {
  list-style: none;
  margin: 0;
  padding: 0.3rem 0 0.3rem 2.3rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.leg.leg-long {
  color: var(--down);
  font-weight: 600;
}

.leg.leg-over {
  padding-left: 0;
  font-style: italic;
}

.drop-hint {
  list-style: none;
  padding: 0.8rem;
  border: 2px dashed var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.day-route {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
}

.cand {
  margin-top: 1.8rem;
  padding-top: 0.8rem;
  border-top: 3px solid var(--line);
}

.cand h3 {
  margin: 0;
  font-size: 1.05rem;
}

.cand .group-sub {
  margin: 0.2rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.cand-list {
  display: grid;
  gap: 0.5rem;
}

.cand-item {
  grid-template-columns: minmax(0, 1fr) auto;
  background: #fff;
  border-style: dashed;
}

.io {
  display: flex;
  gap: 1.2rem;
  margin: 1.6rem 0 0;
  font-size: 0.9rem;
}

.day-pin {
  background: none;
  border: 0;
}

.day-pin span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font: 800 13px/1 system-ui, sans-serif;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

@media (max-width: 720px) {
  /* trip length, travel mode and the arrange button share one row */
  .plan-ctl {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
  }

  .plan-ctl .btn {
    grid-column: auto;
    min-height: 2.6rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .plan-ctl label {
    font-size: 0.78rem;
  }

  .plan-ctl select {
    padding: 0.3rem 0.4rem;
    font-size: 16px;
  }

  .stop {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .stop-ctl {
    grid-column: 1 / -1;
    justify-content: flex-start;
    max-width: none;
  }

  .stop-ctl select {
    width: auto;
    flex: 1;
  }

  .mine-bar {
    flex-wrap: wrap;
  }
}

/* "no kind selected" means all kinds, so unselected kind chips are not dimmed */
#panel .cat-chip[aria-pressed="false"] {
  opacity: 1;
  border-color: var(--line);
}

#panel .cat-chip[aria-pressed="true"] {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #fff;
}

/* ---------- phone layout: compact header, map and filters on one screen ---------- */
@media (max-width: 720px) {
  body[data-page="planner"] .site-head .wrap {
    flex-wrap: nowrap;
    padding-block: 0.45rem;
  }

  body[data-page="planner"] .brand {
    font-size: 1rem;
  }

  body[data-page="planner"] .head-nav a {
    display: none;
  }

  body[data-page="planner"] .lang-btn {
    min-height: 2rem;
    padding: 0.2rem 0.7rem;
    font-size: 0.85rem;
  }

  .planner-hero {
    padding-block: 0.5rem;
  }

  .planner-hero .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
  }

  .planner-hero h1 {
    margin: 0;
    font-size: 1.15rem;
    font-stretch: 100%;
    white-space: nowrap;
  }

  .planner-hero .summary {
    display: none;
  }

  .planner-hero .steps {
    margin-top: 0;
    flex-wrap: nowrap;
    gap: 0.35rem;
  }

  .step-btn {
    min-height: 2.2rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.82rem;
    border-width: 1.5px;
    white-space: nowrap;
  }

  .map-col {
    padding-top: 0.5rem;
  }

  .map-col #map {
    height: clamp(170px, 27vh, 250px);
  }

  .map-col .legend {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.2rem 0.8rem;
    margin: 0.3rem 0 0;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .map-col .legend li {
    flex: none;
  }

  .map-col .map-note {
    display: none;
  }

  .mine-bar {
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    gap: 0.5rem;
  }

  .mine-bar .btn {
    min-height: 2.2rem;
    padding: 0.25rem 0.8rem;
    font-size: 0.85rem;
  }

  /* search and prefecture side by side */
  .pfilters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.4rem;
    margin-bottom: 0.5rem;
  }

  .pfilters input,
  .pfilters select {
    min-height: 2.3rem;
    padding: 0.3rem 0.5rem;
    font-size: 16px; /* avoids the iOS zoom-on-focus */
  }

  /* one scrollable row per chip group */
  #panel .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-bottom: 0.4rem;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
  }

  #panel .chips::-webkit-scrollbar {
    display: none;
  }

  #panel .chip {
    flex: none;
    white-space: nowrap;
    padding: 0.28rem 0.6rem;
    font-size: 0.82rem;
  }

  .count {
    margin: 0.4rem 0 0.2rem;
    font-size: 0.85rem;
  }

  /* grid children must be allowed to shrink, or the scrolling rows widen the page */
  .explore,
  .explore > *,
  #panel,
  #planner-root {
    min-width: 0;
    max-width: 100%;
  }

  #panel .chip .tier {
    min-width: 1.2rem;
    height: 1.2rem;
    margin-left: 0;
    font-size: 0.7rem;
  }
}

@media (max-width: 420px) {
  .planner-hero h1 {
    display: none;
  }

  .planner-hero .steps {
    flex: 1;
  }

  .step-btn {
    flex: 1;
    padding-inline: 0.4rem;
  }
}

@media (max-width: 720px) {
  .mine-bar {
    flex-wrap: nowrap;
  }

  .mine-bar strong {
    font-size: 0.82rem;
    line-height: 1.3;
  }

  .mine-bar .btn {
    flex: none;
    white-space: nowrap;
  }

  #panel .tier-chip {
    padding-block: 0.2rem;
  }
}

/* ---------- phone: bigger sticky map, tighter lists ---------- */
@media (max-width: 720px) {
  .map-col {
    position: sticky;
    top: 0;
    z-index: 600;
    background: var(--paper);
    padding-bottom: 0.25rem;
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
    width: calc(100% + 2.5rem);
    max-width: none;
    box-sizing: border-box;
    box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.35);
  }

  .map-col #map {
    height: clamp(230px, 42vh, 420px);
  }

  /* place cards: two lines of text, small buttons */
  .pcard {
    padding: 0.55rem 0;
  }

  .pcard h3,
  .stop h4 {
    font-size: 1rem;
  }

  .pcard-head {
    gap: 0.4rem;
  }

  .pcard-meta,
  .stop-meta {
    margin: 0.1rem 0 0;
    font-size: 0.8rem;
  }

  .pcard .desc {
    margin: 0.15rem 0 0.3rem;
    font-size: 0.85rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .pcard-actions {
    margin: 0.2rem 0 0;
    gap: 0.35rem 0.6rem;
  }

  .pcard-actions .btn,
  .stop .btn {
    min-height: 2.1rem;
    padding: 0.2rem 0.65rem;
    font-size: 0.82rem;
  }

  .pcard-actions .link-btn,
  .stop-actions .link-btn {
    font-size: 0.8rem;
  }

  .stop {
    padding: 0.45rem 0.5rem;
    gap: 0.4rem;
  }

  .stop-actions {
    margin: 0.1rem 0 0;
  }

  .cand .group-sub {
    display: none;
  }
}

/* ---------- start / end points ---------- */
.endpoints {
  background: var(--panel);
  border-left: 5px solid #0a8f3c;
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.8rem;
}

.endpoints summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
  align-items: baseline;
}

.endpoints .ep-sum {
  font-size: 0.9rem;
  color: var(--muted);
}

.ep-row {
  margin-top: 0.6rem;
}

.ep-row > label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.ep-row select,
.ep-row input[type="text"] {
  width: 100%;
  font: inherit;
  padding: 0.4rem 0.6rem;
  min-height: 2.5rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
}

.ep-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem;
  margin-top: 0.4rem;
  align-items: center;
}

.ep-btns {
  display: inline-flex;
  gap: 0.3rem;
}

.ep-msg,
.ep-hint {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.ep-results {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  font-size: 0.88rem;
}

.ep-results li {
  padding: 0.25rem 0;
  border-top: 1px solid var(--line);
}

.ep-pin span {
  display: inline-block;
  min-width: 38px;
  padding: 2px 0;
  text-align: center;
  color: #fff;
  font: 800 12px/18px system-ui, sans-serif;
  border: 2px solid #fff;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

@media (max-width: 720px) {
  .ep-custom {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- compact stop rows: controls sit on the right of the name row ---------- */
.stop {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
}

.stop-ctl {
  grid-column: auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  max-width: none;
  gap: 0.25rem;
}

.stop-ctl select {
  width: 5rem;
  flex: none;
  min-height: 0;
  padding: 0.25rem 0.3rem;
}

.stop-ctl .icon-btn {
  width: 1.9rem;
  height: 1.9rem;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--indigo);
  text-decoration: none;
  vertical-align: middle;
}

.stop-ctl .icon-link {
  width: 1.9rem;
  height: 1.9rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  flex: none;
}

.leg .icon-link {
  width: 1.6rem;
  height: 1.6rem;
}

.stop-main h4 {
  font-size: 1rem;
}

.stop-main .stop-meta,
.stop-main .stop-actions {
  margin-top: 0.1rem;
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  .stop {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .stop-ctl {
    grid-column: auto;
    max-width: none;
    justify-content: flex-end;
  }

  .stop-ctl select {
    width: 4.6rem;
    flex: none;
  }
}

/* name row: number, name, controls; second row: place info and links across the full width */
.stop:not(.cand-item) {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  row-gap: 0.1rem;
  align-items: center;
}

.stop:not(.cand-item) .stop-main {
  display: contents;
}

.stop:not(.cand-item) .stop-num {
  grid-column: 1;
  grid-row: 1;
}

.stop:not(.cand-item) h4 {
  grid-column: 2;
  grid-row: 1;
}

.stop:not(.cand-item) .stop-ctl {
  grid-column: 3;
  grid-row: 1;
}

.stop:not(.cand-item) .stop-meta-row {
  grid-column: 2 / -1;
  grid-row: 2;
  margin: 0;
  font-size: 0.8rem;
}

.stop-meta-row .link-btn {
  font-size: 0.8rem;
}

.stop:not(.cand-item) .stop-ctl .icon-btn,
.stop:not(.cand-item) .stop-ctl .icon-link {
  width: 1.75rem;
  height: 1.75rem;
}

.stop:not(.cand-item) .stop-ctl select {
  width: 4.3rem;
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  .stop:not(.cand-item) .stop-ctl {
    grid-column: 3;
  }
}

.stop:not(.cand-item) h4 { display: block; font-size: 0.95rem; line-height: 1.25; }
.stop:not(.cand-item) h4 .tier { display: inline-block; vertical-align: 1px; margin-left: 0.35rem; font-size: 0.7rem; padding: 0.05rem 0.4rem; line-height: 1.3; }

.day-head .day-route-link { margin-left: auto; font-size: 0.85rem; white-space: nowrap; }

/* in-page Google Maps view over the map */
.map-wrap { position: relative; }
.gview { position: absolute; inset: 0; z-index: 1100; display: flex; flex-direction: column; background: var(--bg, #fff); border-radius: inherit; overflow: hidden; border: 1px solid #c9ced6; }
.gview[hidden] { display: none; }
.gview-bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.25rem 0.5rem; background: #fff; font-size: 0.85rem; border-bottom: 1px solid #dde1e6; }
.gview-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gview-ext { white-space: nowrap; font-size: 0.8rem; }
.gview-close { border: 1px solid currentColor; background: #fff; border-radius: 6px; padding: 0.15rem 0.6rem; font: inherit; cursor: pointer; }
.gview-frame { flex: 1; width: 100%; border: 0; min-height: 0; }

/* time-split bar inline at the end of the totals line */
.day-totals { display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.4rem; margin: 0.35rem 0 0.4rem; }
.day-totals .load-bar { width: 4.5rem; flex: none; height: 0.55rem; margin: 0; }
.day-totals { flex-wrap: nowrap; font-size: 0.82rem; white-space: nowrap; }
.day-totals .load-bar { flex: 1 1 2rem; width: auto; min-width: 1.5rem; max-width: 4.5rem; }

.hotel-row { margin: 0.2rem 0 0.4rem; font-size: 0.85rem; }
.hotel-row summary { cursor: pointer; padding: 0.2rem 0; }
.hotel-row .ep-row { margin-top: 0.3rem; }

/* hotel field: name input with the two buttons on one row */
.hotel-row .ep-custom { grid-template-columns: minmax(0, 1fr) auto; margin-top: 0.25rem; }
.hotel-row .ep-btns { flex-wrap: nowrap; }
.hotel-row .ep-btns .btn { white-space: nowrap; padding: 0.35rem 0.5rem; font-size: 0.8rem; min-height: 2.5rem; }
.hotel-row .ep-row > label { font-size: 0.85rem; }
@media (max-width: 720px) { .hotel-row .ep-custom { grid-template-columns: minmax(0, 1fr) auto; } }

@media (max-width: 720px) {
  body[data-page="planner"] .head-nav a#t-nav-data { display: inline; font-size: 0.8rem; }
}

.pcard.in-list { padding-inline: 0.6rem; border-radius: 6px; }

/* selected-places summary: same type size as the start/end title, opens a list */
.mine-bar .mine-toggle { font: inherit; font-weight: 700; font-size: 1rem; background: none; border: 0; padding: 0.2rem 0; color: inherit; cursor: pointer; text-align: left; }
.mine-bar { font-size: 1rem; }
.mine-list { background: var(--panel); border-left: 5px solid #7b2cbf; padding: 0.4rem 0.8rem 0.6rem; margin-bottom: 0.8rem; }
.mine-list h4 { margin: 0.5rem 0 0.2rem; font-size: 0.95rem; }
.mine-empty { margin: 0 0 0.3rem; color: var(--muted); font-size: 0.85rem; }
.mine-items { list-style: none; margin: 0; padding: 0; }
.mine-items li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.2rem 0.5rem; align-items: center; padding: 0.35rem 0; border-top: 1px solid var(--line); }
.mine-name { font-weight: 600; }
.mine-ctl { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.4rem; }
@media (max-width: 720px) { .mine-bar { font-size: 1rem; } }

/* trip details and records */
.trip-info { background: var(--panel); border-left: 5px solid #1e3358; padding: 0.55rem 0.8rem; margin-bottom: 0.8rem; }
.trip-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 11rem); gap: 0.5rem; margin-top: 0.4rem; }
.trip-fields label { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.82rem; font-weight: 600; min-width: 0; }
.trip-fields input { font: inherit; padding: 0.35rem 0.5rem; min-height: 2.4rem; border: 1.5px solid var(--ink); border-radius: var(--radius); background: #fff; color: var(--ink); width: 100%; box-sizing: border-box; }
.trip-period { margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--muted); }
.trip-record { margin: 0.8rem 0; display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.trip-msg { color: #0a8f3c; font-size: 0.9rem; }
.trips-head { margin: 0.6rem 0; }
.trip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.trip-card { background: var(--panel); border-left: 5px solid #1e3358; padding: 0.6rem 0.8rem; }
.trip-card.is-current { border-left-color: #0a8f3c; }
.trip-card h4 { margin: 0; font-size: 1.05rem; }
.trip-meta { margin: 0.2rem 0 0.4rem; font-size: 0.88rem; color: var(--muted); }
.trip-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.trip-detail { margin-top: 0.4rem; font-size: 0.9rem; }
.trip-detail summary { cursor: pointer; padding: 0.2rem 0; }
.trip-days { margin: 0.3rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.4rem; }
.trip-days li { display: grid; gap: 0.1rem; border-top: 1px solid var(--line); padding-top: 0.3rem; }
.trip-hotel { color: var(--muted); font-size: 0.85rem; }
@media (max-width: 720px) {
  .trip-fields { grid-template-columns: minmax(0, 1fr) 9.5rem; }
  .steps .step-btn { padding-inline: 0.5rem; font-size: 0.8rem; }
}

.auto-pick { margin: 0.2rem 0 0.8rem; }
.auto-btn { width: 100%; background: #1e3358; color: #fff; border-color: #1e3358; font-weight: 700; }
.auto-hint { margin: 0.3rem 0 0; font-size: 0.8rem; color: var(--muted); }
.auto-msg { margin: 0.4rem 0 0; font-size: 0.9rem; font-weight: 600; }

/* quick plan */
.easy { padding: 1rem 0; max-width: 34rem; }
.easy-title { margin: 0 0 0.3rem; font-size: 1.25rem; }
.easy-lead { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.92rem; }
.easy-form { display: grid; gap: 0.7rem; }
.easy-field { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; font-weight: 600; }
.easy-field select { font: inherit; padding: 0.4rem 0.6rem; min-height: 2.6rem; border: 1.5px solid var(--ink); border-radius: var(--radius); background: #fff; color: var(--ink); width: 100%; }
.easy-go { width: 100%; margin-top: 0.9rem; min-height: 2.9rem; font-size: 1rem; background: #1e3358; color: #fff; border-color: #1e3358; font-weight: 700; }
.easy-go:disabled { opacity: 0.5; }
.easy-soon { margin: 0.7rem 0 0; color: #b4530a; font-size: 0.9rem; font-weight: 600; }
.easy-more { margin: 0.9rem 0 0; font-size: 0.9rem; }
.ep-pin span { min-width: 52px; }
@media (max-width: 720px) {
  .planner-hero .steps { overflow-x: auto; }
  .planner-hero .steps .step-btn { flex: none; white-space: nowrap; padding-inline: 0.6rem; font-size: 0.8rem; }
}

/* the quick-plan screen has no map until a plan exists */
body[data-tab="easy"] .map-col { display: none; }
body[data-tab="easy"] .explore { display: block; }

/* the page title now lives in the header, so the hero shows only the four tabs */
.planner-hero h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
@media (max-width: 720px) {
  .planner-hero .wrap { display: block; }
  .planner-hero .steps { overflow: visible; width: 100%; flex: none; gap: 0.25rem; }
  .planner-hero .steps .step-btn { flex: 1 1 0; min-width: 0; white-space: normal; text-align: center; line-height: 1.15; padding: 0.2rem 0.1rem; font-size: 0.7rem; min-height: 2.5rem; letter-spacing: -0.02em; }
}

/* route image dialog */
.img-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(10, 16, 28, 0.78); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 1rem 0.6rem; }
.img-box { background: #fff; border-radius: 8px; padding: 0.7rem; width: min(100%, 560px); }
.img-route { display: block; width: 100%; height: auto; border-radius: 4px; margin-top: 0.6rem; }
.img-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.img-actions a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.img-busy { margin: 0.5rem 0; }

.full-route { width: 100%; margin: 0 0 0.8rem; font-weight: 700; }
.gview-part { font: inherit; font-size: 0.8rem; max-width: 7rem; }
.gview-note { margin: 0; padding: 0.15rem 0.5rem; font-size: 0.75rem; background: #fff8e1; color: #6b4b00; }
.gview-note[hidden], .gview-part[hidden] { display: none; }

@media (max-width: 720px) {
  .planner-hero .steps .step-btn { font-size: 0.8rem; letter-spacing: 0; min-height: 2.8rem; padding: 0.2rem 0.1rem; line-height: 1.2; }
}

@media (max-width: 720px) {
  .planner-hero .steps .step-btn:first-child { flex: 1.3 1 0; }
}
