body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body.map-page {
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

.side-panel {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 9;
  width: 360px;
  max-width: calc(100vw - 54px);
  background: #fff;
  border-right: 1px solid #d6d9de;
  box-shadow: 8px 0 26px rgba(15, 23, 42, 0.18);
  transform: translateX(0);
  transition: transform 0.24s ease;
}

.panel-collapsed .side-panel {
  transform: translateX(calc(-100% + 18px));
}

.panel-content {
  height: 100%;
  overflow: auto;
  padding-bottom: 18px;
}

.panel-handle {
  position: absolute;
  top: 50%;
  right: -28px;
  width: 30px;
  height: 86px;
  padding: 0;
  border: 1px solid #d6d9de;
  border-left: 0;
  border-radius: 0 16px 16px 0;
  background: #fff;
  cursor: grab;
  transform: translateY(-50%);
  box-shadow: 6px 0 18px rgba(15, 23, 42, 0.16);
}

.panel-handle:active {
  cursor: grabbing;
}

.panel-handle span {
  display: block;
  width: 4px;
  height: 34px;
  margin: auto;
  border-radius: 999px;
  background: #9ca3af;
}

.panel-hero {
  padding: 20px 20px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.panel-hero h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.panel-hero p {
  margin: 8px 0 0;
  color: #374151;
  font-size: 15px;
}

.about-link {
  display: inline-flex;
  margin-top: 10px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.about-link:hover {
  text-decoration: underline;
}

.panel-section {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.panel-section h2 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: 0;
}

.category-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-menu li {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  color: #111827;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.post-list {
  display: grid;
  gap: 8px;
}

.post-list:empty::before {
  content: "まだ投稿がありません";
  color: #6b7280;
  font-size: 13px;
}

.my-post-list:empty::before {
  content: "このブラウザの投稿履歴はまだありません";
}

.my-page-count {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
}

.post-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.post-list-item:hover {
  background: #f9fafb;
}

.post-list-category {
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}

.post-list-message {
  color: #1f2937;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.post-list-date {
  color: #6b7280;
  font-size: 11px;
}

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

.roadmap-list li {
  padding: 9px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  line-height: 1.35;
}

#formModal {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  z-index: 10;
  min-width: 320px;
  max-width: 400px;
}

#formModal[hidden],
.status-message[hidden],
.share-link[hidden] {
  display: none;
}

#formModal h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
  color: #333;
  text-align: center;
}

#categorySelect {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  margin-bottom: 12px;
  box-sizing: border-box;
  background: white;
}

#messageInput {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 15px;
  box-sizing: border-box;
  min-height: 60px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
}

#submitBtn {
  flex: 1;
  background-color: #007bff;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background-color 0.2s;
}

#submitBtn:hover {
  background-color: #0056b3;
}

#submitBtn:active {
  background-color: #004085;
}

#cancelBtn {
  flex: 1;
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: background-color 0.2s;
}

#cancelBtn:hover {
  background-color: #545b62;
}

.status-message {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  max-width: min(90vw, 460px);
  padding: 10px 14px;
  border-radius: 6px;
  background: #1f2937;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.status-message[data-type="success"] {
  background: #047857;
}

.status-message[data-type="warning"] {
  background: #92400e;
}

.status-message[data-type="error"] {
  background: #b91c1c;
}

.share-link {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 11;
  padding: 10px 14px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.emoji-marker {
  position: relative;
  width: 54px;
  height: 66px;
  cursor: pointer;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.32));
}

.emoji-marker::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 12px;
  width: 36px;
  height: 36px;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 7px;
  background: linear-gradient(135deg, #ff4d4f 0%, #dc2626 72%);
  transform: rotate(-45deg);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.35);
}

.emoji-marker::after {
  content: attr(data-emoji);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  font-size: 21px;
  line-height: 28px;
  text-align: center;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
}

.emoji-marker:hover {
  transform: scale(1.08);
}

/* SVGマーカーのスタイル */
.svg-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.svg-marker svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.svg-marker:hover svg {
  transform: scale(1.1);
}

/* マーカーのポップアップスタイル調整 */
.maplibregl-popup-content {
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 760px) {
  .side-panel {
    inset: auto 0 0 0;
    width: auto;
    max-width: none;
    height: min(62vh, 520px);
    border: 0;
    border-top: 1px solid #d6d9de;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 26px rgba(15, 23, 42, 0.2);
    transform: translateY(0);
  }

  .panel-collapsed .side-panel {
    transform: translateY(calc(100% - 54px));
  }

  .panel-handle {
    top: 0;
    left: 50%;
    right: auto;
    width: 96px;
    height: 34px;
    border: 0;
    border-radius: 0;
    background: transparent;
    transform: translateX(-50%);
    box-shadow: none;
  }

  .panel-handle span {
    width: 44px;
    height: 5px;
    margin-top: 12px;
  }

  .panel-content {
    padding-top: 26px;
  }

  .panel-hero {
    padding: 12px 18px;
  }

  .panel-hero h1 {
    font-size: 24px;
  }

  .category-menu {
    grid-template-columns: 1fr;
  }

  #formModal {
    top: 16px;
    width: calc(100vw - 32px);
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
  }

  .status-message {
    top: 12px;
    width: calc(100vw - 32px);
    box-sizing: border-box;
  }

  .share-link {
    top: 12px;
    right: 12px;
  }
}

.about-page {
  min-height: 100%;
  background: #f3f4f6;
  color: #111827;
}

.about-main {
  width: min(720px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.about-main h1 {
  margin: 0 0 8px;
  font-size: 32px;
  letter-spacing: 0;
}

.about-main section {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.about-main h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.about-main p,
.about-main li {
  color: #374151;
  line-height: 1.7;
}
