:root {
  --sky: #a7e7ff;
  --ground: #fff6d8;
  --panel: #ffffff;
  --ink: #18324c;
  --sub: #53718a;
  --outline: #1c3650;
  --route: #2369b3;
  --station: #ffffff;
  --terminal: #ffe57a;
  --crossing: #ffd449;
  --inbound: #2d80ea;
  --outbound: #ff8034;
  --selection: #23c47b;
  --selection-soft: #dff8ea;
  --shadow: 0 18px 40px rgba(24, 50, 76, 0.14);
  --shadow-soft: 0 10px 20px rgba(24, 50, 76, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "BIZ UDPGothic", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 255, 255, 0.85), transparent 14%),
    radial-gradient(circle at 90% 8%, rgba(255, 238, 153, 0.75), transparent 12%),
    linear-gradient(180deg, var(--sky) 0%, #dff5ff 44%, var(--ground) 44%, #fffaf0 100%);
  padding: 10px;
  overflow: hidden;
}

body.drawer-open {
  overflow: hidden;
}

.app {
  width: min(1600px, 100%);
  height: calc(100vh - 20px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.top-bar,
.map-frame,
.side-panel,
.app-drawer {
  background: var(--panel);
  border: 2px solid var(--outline);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.top-bar {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  background:
    radial-gradient(circle at right top, rgba(255, 229, 122, 0.28), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.98));
}

.app-title {
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.top-bar .status-row {
  flex: 1 1 auto;
  flex-wrap: nowrap;
}

.time-compact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  white-space: nowrap;
  border: 3px solid var(--outline);
  border-radius: 18px;
  padding: 6px 12px;
  background: linear-gradient(180deg, #fff8cb, #fffef3);
  box-shadow: var(--shadow-soft);
}

.time-compact .time-value {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-top: 0;
}

.date-compact {
  color: var(--sub);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.eyebrow {
  display: inline-flex;
  align-self: start;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffec8e;
  border: 2px solid var(--outline);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

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

h1 {
  font-size: clamp(1.3rem, 1vw + 0.9rem, 1.9rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  word-break: keep-all;
}

.time-box {
  padding: 10px 14px;
  border-radius: 22px;
  border: 3px solid var(--outline);
  background: linear-gradient(180deg, #fff8cb, #fffef3);
  box-shadow: var(--shadow-soft);
  min-width: 228px;
}

.time-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--sub);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.time-value {
  margin-top: 4px;
  font-size: clamp(1.65rem, 1vw + 1rem, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1;
}

.date-value {
  margin-top: 4px;
  color: var(--sub);
  font-weight: 700;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: #e4f6ff;
  border: 3px solid var(--outline);
  box-shadow: var(--shadow-soft);
}

.segmented label {
  position: relative;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  color: var(--sub);
  transition: 180ms ease;
}

.segmented input:checked + span {
  color: var(--ink);
  background: #ffffff;
  box-shadow: inset 0 0 0 2px var(--outline);
}

.status-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f8fbff;
  border: 2px solid var(--outline);
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.pill strong {
  font-weight: 900;
}

button {
  appearance: none;
  border: 3px solid var(--outline);
  border-radius: 999px;
  padding: 11px 16px;
  background: #7ee38f;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, filter 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

button.secondary {
  background: #ffffff;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
  transform: none;
}

.compact-button {
  padding: 8px 13px;
  font-size: 0.9rem;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-inline: 14px;
  min-height: 58px;
}

.menu-toggle-icon {
  display: inline-grid;
  gap: 4px;
}

.menu-toggle-icon span {
  display: block;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--ink);
}

.content-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  min-height: 0;
}

.map-frame {
  padding: 8px;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.map-legend-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  pointer-events: none;
  z-index: 2;
}

.side-panel {
  padding: 16px 14px;
  display: grid;
  grid-template-rows: 1fr;
  align-items: stretch;
  overflow-y: auto;
}

.side-panel[data-empty="true"] .side-content,
.side-panel[data-empty="false"] .side-empty {
  display: none;
}

.side-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--sub);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.8;
}

.side-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-header .selection-name {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

.side-header .selection-km {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.side-next {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-dir {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.side-dir-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--sub);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(28, 54, 80, 0.1);
}

.side-all {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-all[hidden] {
  display: none;
}

.side-footer {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tt-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tt-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(28, 54, 80, 0.06);
}

.tt-time {
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 76px;
  color: var(--ink);
}

.tt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  color: #fff;
}

.tt-badge.inbound {
  background: var(--inbound);
}

.tt-badge.outbound {
  background: var(--outbound);
}

.tt-rel {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sub);
  margin-left: auto;
  white-space: nowrap;
}

.tt-item.passed {
  opacity: 0.38;
}

.tt-empty {
  font-size: 0.85rem;
  color: var(--sub);
  font-weight: 700;
  padding: 8px 4px;
}

.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 2px solid var(--outline);
  background: #ffffff;
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.map-shell {
  position: relative;
  min-height: 0;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--outline);
  background:
    linear-gradient(180deg, #e9f7ff, #f9fdff 52%, #fffdf4 100%),
    repeating-linear-gradient(
      90deg,
      rgba(35, 105, 179, 0.04) 0,
      rgba(35, 105, 179, 0.04) 1px,
      transparent 1px,
      transparent 48px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(35, 105, 179, 0.04) 0,
      rgba(35, 105, 179, 0.04) 1px,
      transparent 1px,
      transparent 48px
    );
}

.map-shell.is-targeting {
  box-shadow: inset 0 0 0 5px rgba(255, 212, 73, 0.48);
}

#routeMap {
  width: 100%;
  height: 100%;
  display: block;
}

.selection-kind {
  display: inline-flex;
  align-self: start;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--selection-soft);
  color: #0f7c4d;
  border: 2px solid var(--selection);
  font-weight: 900;
  font-size: 0.83rem;
}

.selection-name {
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.3;
}

.selection-km {
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.selection-strip-actions {
  display: none;
}

.meta-grid {
  display: grid;
  gap: 8px;
}

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

.meta-box,
.selection-summary-box {
  padding: 6px 0;
}

.meta-label {
  color: var(--sub);
  font-size: 0.8rem;
  font-weight: 800;
}

.meta-value {
  margin-top: 4px;
  font-weight: 900;
  line-height: 1.35;
}

.selection-mode {
  color: var(--sub);
  font-size: 0.84rem;
  font-weight: 800;
}

.direction-block {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.direction-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 900;
}

.mini {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid var(--outline);
  flex: 0 0 auto;
}

.mini.inbound {
  background: var(--inbound);
}

.mini.outbound {
  background: var(--outbound);
}

.schedule-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.schedule-item,
.empty-item {
  padding: 10px 11px;
  border-radius: 16px;
  border: 2px solid var(--outline);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.empty-item {
  color: var(--sub);
  background: #f9fbfd;
  font-weight: 700;
}

.schedule-item.passed {
  opacity: 0.56;
}

.schedule-main {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.schedule-time {
  font-size: 1rem;
  font-weight: 900;
}

.schedule-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.schedule-badge.inbound {
  background: var(--inbound);
}

.schedule-badge.outbound {
  background: var(--outbound);
}

.schedule-sub {
  margin-top: 4px;
  color: var(--sub);
  font-size: 0.85rem;
  line-height: 1.4;
}

.schedule-relative {
  margin-top: 5px;
  font-size: 0.83rem;
  font-weight: 900;
}

.schedule-list-compact .schedule-item,
.schedule-list-compact .empty-item {
  min-height: 100%;
}

.schedule-list-compact .schedule-sub {
  display: none;
}

.all-passages[hidden] {
  display: none;
}

.all-passages {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.map-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--sub);
  font-size: 0.84rem;
  line-height: 1.4;
}

.drag-picker-dock {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.drag-picker {
  position: relative;
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.drag-picker:active {
  cursor: grabbing;
}

.drag-picker.is-dragging {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  transform: translate(-50%, -64%);
  z-index: 1000;
  cursor: grabbing;
  pointer-events: none;
  box-shadow: 0 18px 28px rgba(24, 50, 76, 0.24);
}

.drag-picker-dock.is-dragging .drag-picker-copy {
  opacity: 0.26;
}

.drag-picker-copy {
  padding: 10px 14px;
  border-radius: 999px;
  border: 3px solid var(--outline);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--ink);
  white-space: nowrap;
  pointer-events: none;
}

.drag-picker-person {
  position: relative;
  width: 24px;
  height: 38px;
  display: inline-block;
  flex: 0 0 auto;
}

.drag-picker-head {
  position: absolute;
  top: 0;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #ffb631;
  border: 2px solid var(--outline);
}

.drag-picker-body {
  position: absolute;
  left: 50%;
  top: 11px;
  width: 11px;
  height: 18px;
  margin-left: -5.5px;
  border-radius: 7px;
  background: #ff8c42;
  border: 2px solid var(--outline);
}

.drag-picker-body::before,
.drag-picker-body::after {
  content: "";
  position: absolute;
  bottom: -9px;
  width: 4px;
  height: 11px;
  border-radius: 4px;
  background: var(--outline);
}

.drag-picker-body::before {
  left: 0;
  transform: rotate(12deg);
}

.drag-picker-body::after {
  right: 0;
  transform: rotate(-12deg);
}

.legend-dot,
.legend-square {
  width: 15px;
  height: 15px;
  display: inline-block;
  border: 2px solid var(--outline);
  flex: 0 0 auto;
}

.legend-dot {
  border-radius: 50%;
  background: var(--station);
}

.legend-dot.terminal {
  background: var(--terminal);
}

.legend-dot.selection {
  background: var(--selection);
}

.legend-square.inbound {
  background: var(--inbound);
  border-radius: 5px;
}

.legend-square.outbound {
  background: var(--outbound);
  border-radius: 5px;
}

.legend-triangle {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 14px solid var(--crossing);
  filter: drop-shadow(0 1px 0 var(--outline));
  flex: 0 0 auto;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(24, 50, 76, 0.18);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.app-drawer {
  position: fixed;
  top: 10px;
  right: 10px;
  bottom: 10px;
  width: min(420px, calc(100vw - 20px));
  z-index: 30;
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  transform: translateX(calc(100% + 18px));
  transition: transform 220ms ease;
  background: linear-gradient(180deg, #ffffff, #fffdfa);
}

.app-drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-kicker {
  color: var(--sub);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drawer-head h2 {
  margin-top: 2px;
  font-size: 1.3rem;
}

.drawer-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 16px;
  padding-right: 4px;
}

.drawer-section {
  padding: 14px 2px;
  border-bottom: 1px solid rgba(28, 54, 80, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-section:last-child {
  border-bottom: none;
}

.drawer-app-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-app-info h2 {
  font-size: 1.1rem;
}

.drawer-app-info p {
  color: var(--sub);
  font-size: 0.84rem;
  line-height: 1.5;
}

.drawer-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.drawer-section h3 {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sub);
}

.drawer-location-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-info-item {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.drawer-info-label {
  font-size: 0.75rem;
  color: var(--sub);
  font-weight: 700;
  white-space: nowrap;
}

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

.location-button {
  width: 100%;
  border: 1px solid rgba(28, 54, 80, 0.2);
  border-radius: 10px;
  background: #ffffff;
  padding: 8px 10px;
  text-align: left;
  display: grid;
  gap: 2px;
  font-weight: 800;
}

.location-button.is-active {
  background: var(--selection-soft);
  border-color: var(--selection);
}

.location-name {
  font-size: 0.94rem;
  line-height: 1.25;
}

.location-meta {
  color: var(--sub);
  font-size: 0.8rem;
  font-weight: 800;
}

.drawer-note {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f0f6ff;
  border-left: 3px solid var(--route);
  color: var(--sub);
  line-height: 1.6;
  font-size: 0.92rem;
}

/* ─── Fix [hidden] attribute being overridden by display:grid ─── */
.app-drawer[hidden] {
  display: none;
}

/* ─── km adjuster panel ─── */
.km-adjuster[hidden] {
  display: none;
}

.km-adjuster {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.km-adj-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.km-adj-btn {
  flex: 0 0 auto;
  width: 42px;
  padding: 7px 0;
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
}

.km-adj-input {
  flex: 1;
  min-width: 0;
  border: 3px solid var(--outline);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-weight: 900;
  font-size: 0.95rem;
  text-align: center;
  background: #fff;
  color: var(--ink);
  -moz-appearance: textfield;
  appearance: textfield;
  outline: none;
}

.km-adj-input::-webkit-inner-spin-button,
.km-adj-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.km-adj-input:focus {
  border-color: var(--route);
}

.km-adj-context {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sub);
  text-align: center;
  line-height: 1.6;
  white-space: pre-line;
}

/* ─── Bottom sheet handle (visible only on mobile) ─── */
.sheet-handle-bar {
  display: none;
}

/* ─── GitHub link in drawer ─── */
.drawer-github-link {
  display: inline-flex;
  align-items: center;
  color: var(--route);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  gap: 4px;
}
.drawer-github-link:hover {
  text-decoration: underline;
}

/* ─── Mobile: bottom-sheet layout ─── */
@media (max-width: 680px) {
  /* Full-bleed, no scroll on body */
  body {
    padding: 0;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
  }

  .app {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    gap: 0;
  }

  /* ── Compact top bar ── */
  .top-bar {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    padding: 5px 10px;
    gap: 6px;
  }

  .app-title {
    font-size: 0.68rem;
    line-height: 1.2;
  }

  /* Hide running-train count pills (less critical on mobile) */
  .top-bar .status-row {
    display: none;
  }

  .segmented {
    padding: 3px;
    border-width: 2px;
  }

  .segmented span {
    min-width: 56px;
    padding: 5px 8px;
    font-size: 0.84rem;
  }

  .time-compact {
    padding: 4px 8px;
    border-width: 2px;
    border-radius: 12px;
    gap: 0;
  }

  .time-compact .time-value {
    font-size: 1.05rem;
    letter-spacing: 0.01em;
  }

  /* Hide date on mobile — clock alone is enough */
  .date-compact {
    display: none;
  }

  .menu-toggle {
    min-height: 38px;
    padding: 0 10px;
    gap: 5px;
    font-size: 0.82rem;
  }

  .menu-toggle-icon span {
    width: 14px;
  }

  /* ── Map fills all remaining height ── */
  .content-area {
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
  }

  .map-frame {
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .map-shell {
    border-radius: 0;
    border: none;
    min-height: unset;
  }

  /* ── Drag picker: top-right so it's clear of the bottom sheet ── */
  .drag-picker-dock {
    top: 10px;
    right: 10px;
    bottom: auto;
    gap: 6px;
  }

  .drag-picker {
    width: 50px;
    height: 50px;
  }

  .drag-picker-copy {
    font-size: 0.78rem;
    padding: 6px 10px;
  }

  /* ── Side panel → bottom sheet ── */
  .side-panel {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    box-shadow: 0 -6px 28px rgba(24, 50, 76, 0.16);
    transform: translateY(100%);
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1),
                max-height 280ms cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    overflow: hidden;
    overscroll-behavior: contain;
  }

  /* Slide in when a point is selected */
  .side-panel[data-empty="false"] {
    transform: translateY(0);
  }

  /* peek: compact — map stays visible above */
  .side-panel[data-empty="false"][data-sheet="peek"] {
    max-height: 36dvh;
    overflow: hidden;
  }

  /* full: expanded — nearly full height */
  .side-panel[data-empty="false"][data-sheet="full"] {
    max-height: 82dvh;
    overflow-y: auto;
  }

  /* Sheet handle */
  .sheet-handle-bar {
    display: block;
    flex-shrink: 0;
    padding: 14px 0 12px;
    touch-action: none;
    cursor: ns-resize;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
  }

  .sheet-handle-bar::before {
    content: "";
    display: inline-block;
    width: 48px;
    height: 5px;
    border-radius: 3px;
    background: rgba(28, 54, 80, 0.28);
  }

  /* Empty state has no content — keep sheet hidden */
  .side-empty {
    display: none;
  }

  .side-content {
    padding-top: 6px;
    gap: 12px;
    flex: 1;
  }

  /* Footer stays pinned at the bottom of the sheet */
  .side-footer {
    position: sticky;
    bottom: 0;
    background: var(--panel);
    padding: 8px 0 2px;
    margin-top: 4px;
    flex-shrink: 0;
  }

  /* ── Drawer: full screen on mobile, explicit transform to prevent stuck-open bug ── */
  .app-drawer {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
    transform: translateX(110%);
  }

  .app-drawer.is-open {
    transform: translateX(0);
  }

  /* ── Location lists: 2 columns ── */
  .location-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .meta-grid-compact {
    grid-template-columns: 1fr;
  }
}