:root {
  --paper: #fcfaf7;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e7e2d8;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --radius-card: 18px;
  --slot-bg: #f8f3eb;
  --tab-bg: rgba(255, 255, 255, 0.9);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body.sheet-open,
body.map-open,
body.config-open,
body.item-open {
  overflow: hidden;
}

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

button:disabled {
  cursor: not-allowed;
}

.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(1.1) blur(12px);
  background: rgba(252, 250, 247, 0.95);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  margin: 0 auto;
  padding: 16px clamp(16px, 4vw, 24px);
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.site-title {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  font-weight: 750;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}

.toolbar-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.toolbar-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.toolbar-group--actions {
  margin-left: auto;
  gap: 8px;
}

.toolbar-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.chip,
.btn,
.tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chip:hover,
.btn:hover,
.tab:hover {
  transform: translateY(-1px);
}

.chip[aria-pressed="true"],
.tab[aria-selected="true"] {
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}


.btn {
  background: #fff;
  border-radius: 12px;
}

.btn--primary {
  background: #2d3a64;
  color: #fff;
  border-color: #2d3a64;
}

.btn--primary:hover {
  background: #233056;
  border-color: #233056;
}

.btn--danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

.btn--danger:hover {
  background: #fecaca;
}

.btn--subtle {
  background: rgba(255, 255, 255, 0.85);
}

.btn:focus-visible,
.chip:focus-visible,
.tab:focus-visible {
  outline: 2px solid rgba(45, 58, 100, 0.4);
  outline-offset: 2px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: 0.75rem;
  color: var(--muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--line);
  display: inline-block;
}


.main {
  padding: 24px clamp(16px, 4vw, 24px);
  max-width: 1200px;
  margin: 0 auto 80px;
}

.calendar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 720px) {
  .calendar {
    grid-template-columns: repeat(2, minmax(340px, 1fr));
  }
}

@media (min-width: 1120px) {
  .calendar {
    grid-template-columns: repeat(3, minmax(360px, 1fr));
  }
}

.day-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px 20px 20px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  min-height: 180px;
  transition: transform 0.2s ease;
}

.day-card[draggable="true"] {
  cursor: grab;
}

.day-card__stripe {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: -1px;
  width: 8px;
  border-radius: var(--radius-card) 0 0 var(--radius-card);
}

.day-card__header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.day-card__date {
  display: flex;
  align-items: center;
  gap: 10px;
}

.day-card__day-number {
  font-size: clamp(1.8rem, 7vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
}

.day-card__date-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.day-card__badges {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day-card__stay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.travel-summary {
  margin: 12px 0;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.04);
  overflow: hidden;
  font-size: 0.85rem;
  transition: box-shadow 0.2s ease;
}

.travel-summary[data-state='pending'] {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.1);
}

.travel-summary[data-state='warning'] {
  border-color: rgba(234, 179, 8, 0.35);
  background: rgba(250, 204, 21, 0.12);
}

.travel-summary[data-state='error'] {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(248, 113, 113, 0.12);
}

.travel-summary__toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
}

.travel-summary__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.travel-summary__title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 650;
  color: var(--muted);
}

.travel-summary__time {
  font-size: 1.05rem;
  font-weight: 700;
}

.travel-summary__caption {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}

.travel-summary__chevron {
  font-size: 1.1rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.travel-summary[data-expanded='true'] .travel-summary__chevron {
  transform: rotate(180deg);
}

.travel-summary__body {
  padding: 0 16px 16px;
  display: grid;
  gap: 12px;
}

.travel-summary[data-expanded='false'] .travel-summary__body {
  display: none;
}

.travel-summary__headline {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: 600;
}

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

.travel-summary__mode {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.travel-summary__route {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.travel-summary__point {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.travel-summary__point-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.travel-summary__point-name {
  font-weight: 600;
}

.travel-summary__arrow {
  font-size: 0.9rem;
  color: var(--muted);
}

.travel-summary__stops,
.travel-summary__legs {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.travel-summary__stops li,
.travel-summary__legs li {
  line-height: 1.3;
}

.travel-summary__more {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.travel-summary__note {
  font-size: 0.82rem;
  color: var(--muted);
}

.travel-summary__transit {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  display: grid;
  gap: 6px;
}

.travel-summary__leg--walk {
  color: var(--muted);
  font-style: italic;
}

.travel-summary__notice {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 0.82rem;
  font-weight: 600;
  color: #b45309;
}

.travel-summary[data-state='error'] .travel-summary__notice {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(248, 113, 113, 0.12);
  color: #b91c1c;
}

.theme-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
}

.theme-chip.theme-chip--link {
  cursor: pointer;
}

.theme-chip.theme-chip--map {
  border-radius: 12px;
}

.theme-chip.theme-chip--travel {
  background: #eef2ff;
  border-color: rgba(79, 70, 229, 0.35);
  color: #3730a3;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.theme-chip.theme-chip--travel[data-state='pending'] {
  color: #1f2937;
}

.theme-chip.theme-chip--travel[data-state='warning'],
.theme-chip.theme-chip--travel[data-state='error'] {
  background: #fff7ed;
  border-color: rgba(194, 65, 12, 0.35);
  color: #9a3412;
}

.slots {
  display: grid;
  gap: 10px;
}

.slot {
  background: var(--slot-bg);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 10px 10px 14px;
  min-height: 70px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.slot[data-drop-hover="true"] {
  border-color: rgba(45, 58, 100, 0.6);
  background: rgba(45, 58, 100, 0.08);
}

.slot__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slot__title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.slot__add {
  font-size: 0.75rem;
  border-radius: 10px;
  padding: 4px 8px;
}


.chiplet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin: 4px 6px 0 0;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.85rem;
  line-height: 1.3;
  cursor: grab;
  user-select: none;
  position: relative;
  min-height: 32px;
  min-width: 0;
}

.chiplet.locked {
  opacity: 0.7;
  cursor: default;
}

.chiplet__time {
  font-weight: 700;
}

.chiplet__actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}

.chiplet__btn {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.7rem;
}

.chiplet__btn:hover {
  background: rgba(45, 58, 100, 0.08);
}


.chiplet__info {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  font-size: 0.75rem;
  color: var(--muted);
  transition: all 0.15s ease;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  margin-left: 2px;
  margin-right: 0;
  box-sizing: content-box;
}


.chiplet__info:hover {
  color: #2d3a64;
  transform: scale(1.1);
}


.chiplet__info:active {
  transform: scale(0.9);
}


.chiplet__info:focus-visible {
  outline: 2px solid rgba(45, 58, 100, 0.4);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(45, 58, 100, 0.1);
}

.chiplet__btn:focus-visible,
.chiplet__info:focus-visible {
  outline: 2px solid rgba(45, 58, 100, 0.4);
  outline-offset: 2px;
}

.day-card__friends {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.friend-chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 12px;
  font-size: 0.75rem;
  background: #fff;
}

.friend-chip.friend-chip--on {
  background: rgba(45, 58, 100, 0.08);
}


.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 60;
}

.sheet-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--line);
  box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.16);
  transform: translateY(105%);
  transition: transform 0.3s ease;
  z-index: 70;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
}

.sheet.sheet--open {
  transform: translateY(0);
}

.sheet__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 8px;
}

.sheet__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sheet__title {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 650;
}

.sheet__tabs {
  display: inline-flex;
  gap: 8px;
  padding: 0 18px 10px;
  position: sticky;
  top: 0;
  background: var(--tab-bg);
  backdrop-filter: blur(8px);
  z-index: 5;
}

.tab {
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.82rem;
}

.sheet__body {
  padding: 0 18px 18px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sheet-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-group__header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sheet-group__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.sheet-group__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.sheet-custom {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
}

.sheet-custom__title {
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.sheet-custom__text {
  font-size: 0.8rem;
  color: var(--muted);
}

.sheet-custom__btn {
  align-self: flex-start;
}

.sheet-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  height: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sheet-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.sheet-card--selected {
  box-shadow: 0 0 0 2px rgba(45, 58, 100, 0.22);
}

.sheet-card__media {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #f3f4f6;
}

.sheet-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sheet-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.sheet-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}

.sheet-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}

.sheet-card__description {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.sheet-card__tag {
  background: rgba(45, 58, 100, 0.08);
  border-radius: 999px;
  padding: 2px 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.68rem;
  color: #1f2937;
}

.sheet-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.sheet-card__action {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
}

.sheet-card--compact .sheet-card__title {
  font-size: 0.88rem;
}

.sheet-card--compact .sheet-card__body {
  gap: 6px;
}

.sheet-card--compact .sheet-card__actions {
  margin-top: 0;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 80;
}

.overlay.is-open {
  display: flex;
}


.overlay__dialog {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  width: min(100%, 1100px);
  height: min(82vh, 780px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.overlay__header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.overlay__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.overlay__content {
  display: flex;
  flex: 1;
  min-height: 0;
}

.overlay__map {
  flex: 1;
  min-height: 0;
}

.overlay__panel {
  width: min(360px, 40%);
  min-width: 260px;
  border-left: 1px solid var(--line);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.overlay__summary {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.25em;
  background: #fff;
}

.overlay__summary strong {
  color: #111827;
}

.overlay__controls {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.9);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.mode-toggle__btn {
  --mode-color: #1f2937;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--mode-color);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  border-radius: 999px;
  padding: 6px 12px;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mode-toggle__btn::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.mode-toggle__btn:not(:disabled):hover {
  background: rgba(37, 99, 235, 0.08);
}

.mode-toggle__btn--active {
  background: var(--mode-color);
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

.mode-toggle__btn--active::before {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: none;
}

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

.mode-toggle__btn--transit {
  --mode-color: #2563eb;
}

.mode-toggle__btn--walking {
  --mode-color: #0f766e;
}

.mode-toggle__btn--driving {
  --mode-color: #f97316;
}

.overlay__subtitle {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.overlay__dialog--item {
  width: min(100%, 720px);
  max-height: 90vh;
}

.item-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  overflow-y: auto;
}

.item-detail__media {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  max-height: 320px;
}

.item-detail__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-detail__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.item-detail__description {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.item-detail__meta {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 0;
}

.item-detail__meta dt {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.item-detail__meta dd {
  margin: 0;
  font-size: 0.88rem;
  color: #1f2937;
}

.item-detail__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.item-detail__links .btn {
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: 12px;
}

.directions {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.85rem;
}

.directions[data-state='empty'],
.directions[data-state='pending'],
.directions[data-state='error'] {
  color: var(--muted);
}

.directions[data-state='pending'],
.directions[data-state='error'] {
  display: grid;
  place-items: center;
  text-align: center;
}

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

.directions__item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
}

.directions__item .directions__icon {
  color: var(--direction-color, inherit);
}

.directions__item[tabindex='-1'] {
  cursor: default;
}

.directions__item--milestone .directions__content {
  border-style: dashed;
  background: rgba(148, 163, 184, 0.14);
}

.directions__item--walk .directions__content {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.04);
}

.directions__item--transit .directions__content {
  border-color: rgba(37, 99, 235, 0.25);
}

.directions__item--drive .directions__content {
  border-color: rgba(249, 115, 22, 0.3);
}

.directions__time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.directions__content {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.directions__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.directions__icon {
  font-size: 1.1rem;
}

.directions__meta {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.directions__detail {
  font-size: 0.82rem;
  line-height: 1.4;
}

.directions__line {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.4);
}

.directions__note {
  font-size: 0.8rem;
  color: var(--muted);
}

.rail-summary {
  margin-top: 20px;
  padding: 16px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  display: grid;
  gap: 12px;
}

.rail-summary h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  color: #1f2937;
}

.rail-summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 16px;
  margin: 0;
}

.rail-summary__grid dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.rail-summary__grid dd {
  margin: 0;
  font-size: 0.85rem;
  color: #111827;
}

.rail-guide {
  margin-top: 24px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.rail-guide__title {
  margin: 0;
  padding: 14px 16px;
  font-size: 0.92rem;
  font-weight: 650;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.rail-guide__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.rail-guide__table th,
.rail-guide__table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  text-align: left;
}

.rail-guide__table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.03);
}

.rail-guide__table tr:last-child td {
  border-bottom: none;
}

@media (max-width: 960px) {
  .overlay__content {
    flex-direction: column;
  }

  .overlay__panel {
    width: 100%;
    min-width: 0;
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .directions {
    max-height: 40vh;
  }
}

@media (max-width: 720px) {
  .overlay {
    padding: 0;
    align-items: stretch;
  }

  .overlay__dialog {
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-height: none;
  }

  .overlay__dialog--item {
    height: 100%;
  }

  .item-detail {
    padding: 20px 16px;
  }

  .item-detail__media {
    max-height: 240px;
  }
}

.overlay__dialog--wide {
  width: min(100%, 1040px);
}

.config-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.library {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.library__actions {
  display: flex;
  justify-content: flex-end;
}

.library__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.library-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.library-card--active {
  border-color: #2563eb;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.18);
}

.library-card__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 650;
}

.library-card__meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.library-card__actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wizard {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.wizard__steps {
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
  flex-wrap: wrap;
}

.wizard__step {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--tab-bg);
  font-size: 0.8rem;
}

.wizard__step.is-active {
  background: #2d3a64;
  color: #fff;
  border-color: #2d3a64;
}

.wizard__body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wizard__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.wizard__progress {
  font-size: 0.82rem;
  color: var(--muted);
}

.wizard__actions {
  display: flex;
  gap: 8px;
}

.wizard-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.wizard-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wizard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wizard-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.wizard-row__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
}

.form-field--readonly {
  padding: 8px 10px;
  background: #f9fafb;
  border: 1px dashed var(--line);
  border-radius: 12px;
  gap: 4px;
}

.form-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.form-input,
.form-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.9rem;
  background: #fff;
}

.form-input[type='color'] {
  padding: 2px;
  height: 38px;
}

.form-select {
  appearance: none;
}

.form-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.form-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #2d3a64;
}

.form-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.8rem;
}

.custom-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-form__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.custom-form__grid--coords {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.leaflet-container {
  width: 100%;
  height: 100%;
  font-family: inherit;
}

.empty-state {
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 600px) {
  .sheet-group__list {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
