:root {
  --bg: #fafafa;
  --panel: #ffffff;
  --panel2: #ffffff;
  --text: #000000;
  --muted: #888888;
  --border: rgba(0, 0, 0, 0.06);
  --accent: #FF6347;
  --accent2: #FF6347;
  --danger: #ff6b6b;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius2: 10px;
  --container: 1160px;
  --font: ui-sans-serif, system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic", "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: radial-gradient(1200px 700px at 30% -10%, rgba(100, 210, 255, 0.08), transparent 50%),
    radial-gradient(900px 500px at 80% 0%, rgba(124, 255, 166, 0.05), transparent 55%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.appShell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* スケルトンスクリーン */
.skeleton-container {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.skeleton-header {
  padding: 24px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.skeleton-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #111827;
}

.skeleton-subtitle {
  margin: 6px 0 0 0;
  font-size: 14px;
  color: #6b7280;
}

.skeleton-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.skeleton-map {
  flex: 1;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  position: relative;
  overflow: hidden;
}

.skeleton-map::after {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 30% 40%, rgba(255,255,255,0.4) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.3) 0%, transparent 50%);
  pointer-events: none;
}

.skeleton-sidebar {
  width: 360px;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow-y: auto;
}

.skeleton-search {
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.skeleton-filter {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.skeleton-results {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.skeleton-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    #f3f4f6 0%,
    #e5e7eb 50%,
    #f3f4f6 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 読み込みインジケーター */
.loading-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #ffffff;
  border: 1.5px solid #e5e7eb;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 999;
  animation: fadeInUp 0.4s ease-out;
}

.loading-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid #e5e7eb;
  border-top-color: #FF6347;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loading {
  max-width: 480px;
  margin: 18vh auto 0;
  padding: 28px 32px 26px;
  border: 1.5px solid #e5e7eb;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.loading__title {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 12px;
}

.loading__spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: #FF6347;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading__note {
  margin-top: 10px;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.6;
}

.topBar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topBar__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
}

.brand__sub {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
}

.tabs {
  display: flex;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.tabBtn {
  border: 1.5px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tabBtn:hover {
  border-color: #cbd5e1;
  background: #f9fafb;
}

.tabBtn[aria-selected="true"] {
  background: linear-gradient(135deg, #FF6347 0%, #b32e1a 100%);
  border-color: #FF6347;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.topActions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  border: 1.5px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
  background: #f9fafb;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btnPrimary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #059669;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btnPrimary:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btnDanger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: #dc2626;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btnDanger:hover {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.main {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
}

.pageTitle {
  margin: 4px 0 14px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #111827;
}

.panelGrid {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 16px;
  align-items: stretch;
  height: calc(100dvh - 260px);
  min-height: 520px;
}

.panel {
  border: 1.5px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panelHeader {
  padding: 18px 20px;
  border-bottom: 1.5px solid #e5e7eb;
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

.panelHeader__title {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  font-size: 18px;
  color: #111827;
}

.panelHeader__meta {
  margin-top: 6px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr 160px;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 768px) {
  .filters {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.01em;
}

.input,
.select,
.textarea {
  border: 1.5px solid #e5e7eb;
  background: #ffffff;
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: all 0.15s ease;
}

.input:hover,
.select:hover {
  border-color: #cbd5e1;
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: #FF6347;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tabBtn:focus,
.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.panelBody {
  padding: 20px;
  overflow: auto;
  flex: 1;
}

.hint {
  padding: 14px 16px;
  border: 1.5px dashed #cbd5e1;
  background: #f9fafb;
  color: #6b7280;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.cardList {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.card {
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card:hover {
  transform: translateY(-2px);
  border-color: #FF6347;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12);
}

.card[aria-selected="true"] {
  border-color: #FF6347;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

.card__title {
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 17px;
  line-height: 1.4;
  color: #111827;
  margin-bottom: 8px;
}

.pill {
  display: inline-block;
  border: none;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #6366f1;
  background: #eef2ff;
  white-space: nowrap;
  margin-bottom: 8px;
}

.pillAccent {
  color: #f59e0b;
  background: #fef3c7;
}

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

.cardLinkBtn {
  display: inline-block;
  border: 1px solid #FF6347;
  background: #FF6347;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  transition: all 0.2s;
}

.cardLinkBtn:hover {
  text-decoration: none;
  background: #b32e1a;
  border-color: #b32e1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.card__meta {
  margin-top: 10px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.card__meta::before {
  content: "📍";
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

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

.tag {
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  background: #f3f4f6;
  border: none;
  color: #4b5563;
}

.tagAccent {
  background: #fef3c7;
  color: #d97706;
  background: rgba(100, 210, 255, 0.08);
}

.tagGreen {
  border-color: rgba(124, 255, 166, 0.35);
  background: rgba(124, 255, 166, 0.08);
}

.mapPanel {
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  background: #ffffff;
}

.mapHeader {
  padding: 18px 20px;
  border-bottom: 1.5px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

.mapHeader__title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: #111827;
}

.mapHeader__note {
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

.map {
  height: calc(100vh - 154px);
  min-height: 520px;
}

.leaflet-container {
  background: #f3f4f6;
}

.marker {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 3px solid #ffffff;
  background: linear-gradient(135deg, #FF6347 0%, #b32e1a 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transition: all 0.2s ease;
}

.marker:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.marker--selected {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #ffffff;
  transform: scale(1.2);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.45);
}

.marker--station {
  background: linear-gradient(135deg, #111827 0%, #374151 100%);
  border-color: #ffffff;
  box-shadow: 0 6px 20px rgba(17, 24, 39, 0.35);
  font-size: 12px;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border: 1.5px solid #e5e7eb;
  padding: 0;
}

.leaflet-popup-content {
  margin: 0;
  font-family: var(--font);
  min-width: 240px;
}

.leaflet-popup-content h3 {
  margin: 0;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  border-bottom: 1.5px solid #e5e7eb;
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

.leaflet-popup-content p {
  margin: 0;
  padding: 12px 16px;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
}

.leaflet-popup-tip {
  background: #ffffff;
  border: 1.5px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-close-button {
  color: #6b7280 !important;
  font-size: 20px !important;
  padding: 8px 12px !important;
  font-weight: 600 !important;
}

.leaflet-popup-close-button:hover {
  color: #111827 !important;
  background: #f3f4f6;
  border-radius: 6px;
}

.section {
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sectionHeader {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent);
}

.sectionHeader__title {
  font-weight: 800;
  font-size: 15px;
  margin: 0;
}

.sectionBody {
  padding: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table th {
  text-align: left;
  color: rgba(233, 236, 243, 0.92);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
}

.table td {
  color: var(--text);
}

.table .muted {
  color: var(--muted);
  font-size: 12px;
}

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

.linkCard {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
}

.linkCard__title {
  font-weight: 800;
  font-size: 14px;
}

.linkCard__meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.footer {
  max-width: var(--container);
  width: 100%;
  margin: 12px auto 32px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.footer a {
  color: var(--accent);
}

.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 16px;
}

.modal {
  width: min(620px, 100%);
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.modalHeader {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modalHeader__title {
  font-weight: 800;
}

.modalBody {
  padding: 14px 16px 16px;
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* Stats Banner */
.statsBanner {
  margin-bottom: 20px;
  background: linear-gradient(135deg, #FF6347 0%, #b32e1a 100%);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.25);
}

.statsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.statCard {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.statCard:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.statLabel {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.statValue {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.statUnit {
  font-size: 18px;
  font-weight: 600;
  margin-left: 4px;
  opacity: 0.9;
}

.statBadge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
}

.badgeIcon {
  font-size: 24px;
  background: rgba(255, 255, 255, 0.95);
  color: #10b981;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.badgeText {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .statsGrid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  .statValue {
    font-size: 28px;
  }
  
  .statsBanner {
    padding: 20px;
  }
}

@media (max-width: 980px) {
  .panelGrid {
    grid-template-columns: 1fr;
    min-height: auto;
    height: auto;
  }
  .brand {
    min-width: 0;
  }
  .map {
    height: 44vh;
    min-height: 320px;
  }
}

@media (max-width: 600px) {
  .panelGrid {
    display: flex;
    flex-direction: column;
  }

  .mapPanel {
    order: -1;
  }

  .topBar__inner {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 4px;
  }

  .tabBtn {
    flex: 0 0 auto;
    padding: 9px 12px;
    font-size: 13px;
  }

  .main {
    padding: 14px;
  }

  .pageTitle {
    font-size: 18px;
    margin: 2px 0 12px;
  }

  .panelHeader,
  .mapHeader {
    padding: 14px 14px;
  }

  .panelBody {
    padding: 14px;
  }

  .panelGrid {
    gap: 12px;
  }

  .filters {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .btn,
  .btnPrimary,
  .btnDanger {
    width: 100%;
  }

  .input,
  .select,
  .textarea {
    width: 100%;
  }

  .card {
    padding: 14px;
  }

  .cardList {
    gap: 10px;
  }

  .card__title {
    font-size: 16px;
  }

  .card__meta {
    display: block;
    gap: 0;
  }

  .card__meta::before {
    display: none;
  }

  .map {
    height: 42vh;
    min-height: 260px;
  }

  /* iPhone safe area */
  .main {
    padding-left: calc(14px + env(safe-area-inset-left));
    padding-right: calc(14px + env(safe-area-inset-right));
  }
}
