.map-page .maplibregl-popup {
  z-index: 5;
}
.demo-frame {
  display: block;
  width: 100%;
  height: 520px;
  border: 1px solid #d7dece;
  border-radius: 14px;
  background: #e4eadb;
}
.live-demo {
  min-width: 0;
}
:root {
  --ink: #172f2b;
  --green: #276d53;
  --cream: #f7f8f3;
  --muted: #67756f;
  --line: #dce3da;
  --white: #fff;
  --accent: #dcebbd;
  font-family: Inter, "Segoe UI", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--cream);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--green);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #8aad59;
  outline-offset: 3px;
}
.hidden {
  display: none !important;
}
.site-header {
  height: 90px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  gap: 20px;
}
.brand {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -1.2px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.badge {
  font-size: 9px;
  letter-spacing: 1.3px;
  border: 1px solid var(--line);
  padding: 5px 7px;
  font-weight: 600;
  border-radius: 4px;
}
nav {
  display: flex;
  gap: 24px;
  align-items: center;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 25px;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 8px;
  color: white;
  padding: 14px 20px;
  font-weight: 600;
  text-decoration: none;
}
.button:hover {
  background: #1c5843;
  text-decoration: none;
}
.button.small {
  padding: 10px 15px;
  font-size: 14px;
}
.button.secondary,
.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.button.secondary:hover,
.ghost:hover {
  background: #e8eee3;
}
.ghost {
  padding: 9px 12px;
  border-radius: 6px;
}
.landing {
  max-width: 1360px;
  margin: auto;
  padding: 0 5vw;
}
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 85px 0 70px;
  align-items: center;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2.2px;
  font-weight: 700;
  color: var(--green);
}
h1 {
  font-size: 38px;
  letter-spacing: -1.3px;
  line-height: 1.4;
  margin: 12px 0 16px;
}
h2 {
  font-size: 20px;
  font-weight: 650;
}
p {
  line-height: 1.85;
}
.hero h1 {
  font-size: clamp(42px, 4.5vw, 68px);
  letter-spacing: -2px;
  line-height: 1.35;
}
.hero em {
  font-style: normal;
  color: var(--green);
}
.lead {
  color: #52645c;
  font-size: 17px;
  margin: 24px 0 30px;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.fine {
  font-size: 12px;
}
.hero-map {
  position: relative;
  min-height: 425px;
  overflow: hidden;
  border-radius: 18px;
  background: #e4eadb;
  box-shadow: 0 22px 40px #253e2110;
  border: 1px solid #d7dece;
}
.map-grid {
  position: absolute;
  inset: -20%;
  background:
    repeating-linear-gradient(
      25deg,
      transparent 0 52px,
      #ffffff90 53px 61px,
      transparent 62px 100px
    ),
    repeating-linear-gradient(
      115deg,
      transparent 0 65px,
      #ffffff90 66px 72px,
      transparent 73px 110px
    );
  transform: rotate(-12deg);
}
.river {
  position: absolute;
  left: 40%;
  top: -25%;
  height: 150%;
  width: 65px;
  background: #bdcfce;
  transform: rotate(30deg);
  border-radius: 50%;
}
.map-card {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 24px;
  padding: 20px;
  background: #ffffffed;
  border-radius: 10px;
  font-size: 10px;
  letter-spacing: 1px;
  box-shadow: 0 8px 25px #1c493415;
}
.map-card strong,
.map-card small {
  display: block;
  letter-spacing: 0;
  margin-top: 10px;
}
.map-card strong {
  font-size: 16px;
}
.map-card small {
  font-size: 11px;
  color: var(--muted);
}
.dot {
  display: inline-block;
  border-radius: 50%;
  width: 7px;
  height: 7px;
  background: #619049;
  margin-right: 5px;
}
.pin {
  position: absolute;
  font-size: 29px;
  color: var(--green);
  text-shadow: 0 2px 0 white;
}
.pin small {
  font-size: 12px;
  display: block;
  color: var(--ink);
  background: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  text-shadow: none;
}
.pin-a {
  top: 52%;
  left: 66%;
}
.pin-b {
  top: 68%;
  left: 26%;
}
.pin-c {
  top: 38%;
  left: 20%;
}
.sync-pill {
  position: absolute;
  bottom: 20px;
  right: 20px;
  border-radius: 25px;
  background: #173d30;
  color: white;
  font-size: 12px;
  padding: 12px 18px;
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  gap: 40px;
  padding: 35px 0;
}
.steps span {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--muted);
}
.steps p {
  font-size: 14px;
  color: #52645c;
}
.note-panel {
  padding: 35px 0 50px;
  max-width: 800px;
}
footer {
  border-top: 1px solid var(--line);
  padding: 25px 5vw;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
footer span {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.auth-card {
  max-width: 460px;
  margin: 60px auto 100px;
  padding: 32px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.auth-card h1 {
  font-size: 29px;
}
.auth-card .button {
  width: 100%;
  margin-top: 12px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 16px 0 8px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: white;
  border: 1px solid #ccd5cd;
  border-radius: 6px;
  color: var(--ink);
}
textarea {
  resize: vertical;
  font-size: 12px;
}
.text-button {
  border: 0;
  background: none;
  color: var(--green);
  margin-top: 22px;
  padding: 0;
  font-size: 13px;
}
.workspace {
  display: grid;
  grid-template-columns: 265px 1fr;
  min-height: 80vh;
}
aside {
  border-right: 1px solid var(--line);
  padding: 30px 22px;
}
aside .button {
  font-size: 13px;
  width: 100%;
  margin-top: 12px;
}
#map-list {
  margin: 20px 0 35px;
}
.map-item {
  border: 0;
  background: none;
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 7px;
  margin: 6px 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.map-item.selected {
  background: #e2ebd9;
  font-weight: 650;
}
.map-item small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
  font-weight: 400;
}
.aside-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 20px;
}
.workspace-main {
  padding: 40px;
  max-width: 1150px;
  width: 100%;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.page-heading h1 {
  font-size: 30px;
  overflow-wrap: anywhere;
}
.status-badge {
  border-radius: 20px;
  padding: 7px 14px;
  background: #e5ecd9;
  font-size: 12px;
  white-space: nowrap;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 25px 0;
}
.stats article {
  padding: 20px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
}
.stats span {
  font-size: 12px;
  color: var(--muted);
}
.stats strong {
  display: block;
  font-size: 31px;
  margin-top: 10px;
}
.stats .stat-caption {
  font-size: 17px;
  margin-top: 19px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 25px;
  background: white;
  margin: 20px 0;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.panel-heading a {
  font-size: 12px;
}
.dataset-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.file-field,
#csv-preview,
.checkbox,
#upload-submit {
  grid-column: 1/-1;
}
.file-field {
  border: 1px dashed #bdcbbd;
  padding: 20px;
  border-radius: 8px;
  background: #f8faf5;
}
.file-field small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 12px;
}
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.7;
}
.checkbox input {
  width: auto;
  margin: 4px 0;
}
#csv-preview {
  padding: 15px;
  border-radius: 7px;
  background: #eef4e7;
  font-size: 13px;
  overflow: auto;
}
#csv-preview table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 10px;
}
td,
th {
  text-align: left;
  padding: 7px;
  border-bottom: 1px solid #d7e0d1;
  font-size: 12px;
}
#upload-submit {
  margin-top: 18px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.empty {
  text-align: center;
  padding: 100px 20px;
  color: var(--muted);
}
.empty h1 {
  font-size: 26px;
  color: var(--ink);
}
.empty-icon {
  font-size: 70px;
  color: #91aa78;
}
#notice:not(:empty) {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90%;
  z-index: 1000;
  padding: 15px 22px;
  background: #173d30;
  color: white;
  border-radius: 10px;
  box-shadow: 0 5px 25px #0002;
  font-size: 14px;
}
#notice.error {
  background: #923a33;
}
.map-page {
  height: 100dvh;
  overflow: hidden;
}
.map-page #map-canvas {
  position: absolute;
  inset: 0;
}
.map-toolbar {
  position: absolute;
  z-index: 2;
  left: 18px;
  right: 18px;
  top: 18px;
  padding: 15px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffffed;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 4px 25px #0001;
  flex-wrap: wrap;
}
.map-toolbar .brand {
  font-size: 21px;
}
.map-toolbar h1 {
  font-size: 16px;
  margin: 0;
  flex: 1;
  min-width: 100px;
}
.map-toolbar select {
  width: auto;
  max-width: 200px;
  margin: 0;
  padding: 8px;
}
.map-message {
  position: absolute;
  left: 20px;
  bottom: 55px;
  z-index: 3;
  max-width: 450px;
  background: white;
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 8px;
  font-size: 13px;
}
.maplibregl-popup-content h3 {
  font-size: 15px;
  margin: 8px 0;
}
.maplibregl-popup-content p {
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 180px;
  overflow: auto;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: min(440px, 90vw);
  padding: 24px;
}
dialog::backdrop {
  background: #173f3466;
}
#settings {
  margin: 20px auto;
  max-width: 1180px;
}
#settings form {
  max-width: 480px;
}
summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
}
.dataset-row {
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 800px) {
  .site-header {
    height: 75px;
    padding: 0 20px;
  }
  .badge {
    display: none;
  }
  nav {
    gap: 12px;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 45px 0;
    gap: 30px;
  }
  .hero-map {
    min-height: 340px;
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  aside {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 20px;
  }
  #map-list {
    display: flex;
    overflow: auto;
    margin: 10px 0;
  }
  .map-item {
    min-width: 160px;
  }
  #create-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
  }
  #create-form input {
    flex: 1;
    min-width: 180px;
  }
  #create-form .button {
    width: auto;
  }
  #create-form label,
  .aside-note {
    display: none;
  }
  .workspace-main {
    padding: 20px;
  }
  .stats {
    gap: 8px;
  }
  .stats article {
    padding: 13px;
  }
  .stats .stat-caption {
    font-size: 13px;
  }
  .upload-grid {
    grid-template-columns: 1fr;
  }
  .page-heading h1 {
    font-size: 24px;
  }
  .panel {
    padding: 18px;
  }
  .auth-card {
    margin: 35px 15px;
  }
  #account {
    display: none;
  }
  .map-toolbar {
    left: 8px;
    right: 8px;
    top: 8px;
    padding: 10px;
    gap: 10px;
  }
  .map-toolbar h1 {
    flex-basis: 50%;
  }
  .map-toolbar .muted {
    font-size: 11px;
  }
  footer span {
    max-width: 50%;
    text-align: right;
  }
}
