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(-100%);
}

.panel-collapsed .panel-handle {
  left: 0;
}

.panel-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.panel-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.panel-handle {
  position: absolute;
  top: 50%;
  left: 360px;
  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: "No posts yet";
  color: #6b7280;
  font-size: 13px;
}

.my-post-list:empty::before {
  content: "No post history in this browser yet";
}

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

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.share-post-button,
.x-share-post-button,
.delete-post-button {
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.share-post-button {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.share-post-button:hover {
  background: #dbeafe;
}

.x-share-post-button {
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
}

.x-share-post-button:hover {
  background: #374151;
}

.delete-post-button {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.delete-post-button:hover {
  background: #fee2e2;
}

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

.panel-footer {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  padding: 18px 20px 22px;
  background: #111827;
  color: #d1d5db;
  font-size: 12px;
}

.panel-footer a {
  color: #f9fafb;
  text-decoration: none;
  font-weight: 700;
}

.panel-footer a:hover {
  text-decoration: underline;
}

.panel-footer span {
  color: #9ca3af;
}

.operator-contact {
  display: grid;
  gap: 7px;
  margin-bottom: 6px;
}

.x-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.x-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #f9fafb;
  color: #111827 !important;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.contact-mail {
  overflow-wrap: anywhere;
}

#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],
.completion-panel[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;
}

.completion-panel {
  position: absolute;
  inset: 0;
  z-index: 13;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.36);
}

.completion-panel-body {
  width: min(360px, 100%);
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.completion-panel-body h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 20px;
  letter-spacing: 0;
}

.completion-panel-body p {
  margin: 0 0 14px;
  color: #374151;
  font-size: 14px;
}

.completion-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.completion-actions button {
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.completion-share {
  grid-column: 1 / -1;
  border: 1px solid #1d4ed8;
  background: #2563eb;
  color: #fff;
}

.completion-x-share {
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
}

.completion-close {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
}

.emoji-marker {
  width: 42px;
  height: 64px;
  cursor: pointer;
}

.emoji-marker-inner {
  position: relative;
  width: 42px;
  height: 64px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.32));
}

.emoji-marker-pin {
  position: absolute;
  inset: 0;
  width: 42px;
  height: 64px;
  overflow: visible;
}

.emoji-marker-pin path {
  fill: #dc2626;
  stroke: #fff;
  stroke-width: 3;
}

.emoji-marker-badge {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  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);
  transition: transform 0.15s ease;
}

.emoji-marker:hover .emoji-marker-badge {
  transform: translateX(-50%) scale(1.08);
}

/* Marker popup tweaks */
.maplibregl-popup-content {
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.post-popup {
  display: grid;
  gap: 6px;
  min-width: 160px;
}

@media (max-width: 760px) {
  .side-panel {
    inset: 0 auto 0 0;
    width: min(240px, 56vw);
    max-width: calc(100vw - 64px);
    height: auto;
    overflow: hidden;
    border: 0;
    border-right: 1px solid #d6d9de;
    border-radius: 0;
    box-shadow: 8px 0 26px rgba(15, 23, 42, 0.22);
    transform: translateX(0);
  }

  .panel-collapsed .side-panel {
    transform: translateX(-100%);
  }

  .panel-handle {
    top: 12px;
    left: min(240px, 56vw);
    right: auto;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #d6d9de;
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: #fff;
    transform: none;
    box-shadow: 5px 0 16px rgba(15, 23, 42, 0.18);
  }

  .panel-collapsed .panel-handle {
    left: 0;
  }

  .panel-handle span {
    position: relative;
    width: 18px;
    height: 2px;
    margin: 0;
    border-radius: 999px;
    background: #111827;
    transition: background 0.24s ease;
  }

  .panel-handle span::before,
  .panel-handle span::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #111827;
    transition: top 0.24s ease, transform 0.24s ease;
  }

  .panel-handle span::before {
    top: -6px;
  }

  .panel-handle span::after {
    top: 6px;
  }

  body:not(.panel-collapsed) .panel-handle span {
    background: transparent;
  }

  body:not(.panel-collapsed) .panel-handle span::before {
    top: 0;
    transform: rotate(45deg);
  }

  body:not(.panel-collapsed) .panel-handle span::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .panel-content {
    display: block;
    height: 100%;
    margin-top: 0;
    padding-top: 0;
    overflow: auto;
  }

  .panel-scroll {
    overflow: visible;
    overscroll-behavior: contain;
  }

  .panel-footer {
    position: static;
  }

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

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

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

  .category-menu li {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 12px;
  }

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

}

.about-page {
  min-height: 100%;
  background: #f8fafc;
  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;
}

.about-main a {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
}

.about-main a:hover {
  text-decoration: underline;
}

.legal-main h1 {
  margin-bottom: 14px;
}

.site-footer {
  margin-top: 28px;
  padding: 18px 0 0;
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 13px;
}

.site-footer p {
  margin: 0 0 10px;
  color: #6b7280;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}
