:root {
  --app-width: 430px;
  --bg: #e9edf1;
  --surface: #e9edf1;
  --surface-raised: #eef2f5;
  --surface-pressed: #dde3e8;
  --text: #202833;
  --muted: #657181;
  --line: #d6dde4;
  --accent: #28777c;
  --accent-strong: #1f666b;
  --accent-soft: #d7e7e8;
  --danger: #9a4a18;
  --shadow-light: #ffffff;
  --shadow-dark: #c7d0d9;
  --input-bg: #f3f6f8;
  --focus: #1f8a91;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #dfe5eb;
}

body {
  width: min(100%, var(--app-width));
  min-height: 100vh;
  margin: 0 auto;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 80%), transparent 18rem),
    var(--bg);
  box-shadow: 0 0 36px rgb(15 23 42 / 12%);
  overflow-x: hidden;
}

a {
  color: var(--accent-strong);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 50%);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px auto 0;
  width: min(calc(100% - 32px), 1080px);
  padding: 12px 14px 12px 18px;
  background: color-mix(in srgb, var(--surface-raised), transparent 8%);
  border: 1px solid color-mix(in srgb, var(--shadow-light), transparent 12%);
  border-radius: 8px;
  box-shadow:
    10px 10px 24px var(--shadow-dark),
    -10px -10px 24px var(--shadow-light);
  backdrop-filter: blur(12px);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.site-logo {
  display: inline-grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  margin-right: 12px;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  place-items: center;
  background: #0f63d8;
  border: 2px solid #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgb(15 99 216 / 24%);
}

.site-title,
.site-subtitle {
  display: block;
}

.site-title {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
}

.site-subtitle {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.header-actions,
.site-nav {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 12px;
}

.site-nav {
  gap: 8px;
}

.site-nav a {
  min-width: 48px;
  padding: 7px 10px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-pressed);
  box-shadow:
    inset 3px 3px 7px var(--shadow-dark),
    inset -3px -3px 7px var(--shadow-light);
}

.page {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 36px 16px 56px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.25;
}

h1 {
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  border: 0;
  border-radius: 8px;
  box-shadow:
    7px 7px 15px var(--shadow-dark),
    -7px -7px 15px var(--shadow-light);
  cursor: pointer;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
}

.button:active,
button:active {
  box-shadow:
    inset 4px 4px 9px rgb(0 0 0 / 22%),
    inset -4px -4px 9px rgb(255 255 255 / 12%);
  transform: translateY(0);
}

.button-secondary {
  color: var(--text);
  background: var(--surface-raised);
}

.map {
  width: 100%;
  height: min(70vh, 560px);
  min-height: 380px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line), transparent 20%);
  border-radius: 8px;
  box-shadow:
    inset 8px 8px 18px var(--shadow-dark),
    inset -8px -8px 18px var(--shadow-light);
}

.leaflet-container {
  color: #202833;
  font: inherit;
}

.caution-marker {
  position: relative;
  width: 42px;
  height: 54px;
  background: transparent;
}

.caution-marker-pin {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 32px;
  height: 32px;
  background: var(--marker-color);
  border: 4px solid #ffffff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 4px 14px rgb(0 0 0 / 38%);
  transform: rotate(-45deg);
}

.caution-marker-dot {
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 1;
  width: 11px;
  height: 11px;
  background: #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.caution-puddle {
  --marker-color: #1f78b4;
}

.caution-closed {
  --marker-color: #d62828;
}

.caution-danger {
  --marker-color: #f59e0b;
}

.caution-default {
  --marker-color: #4b5563;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 16px;
  font-size: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--muted);
  font-weight: 700;
  background: var(--surface-raised);
  border: 0;
  border-radius: 8px;
  box-shadow:
    5px 5px 12px var(--shadow-dark),
    -5px -5px 12px var(--shadow-light);
}

.legend-item:hover,
.legend-item.is-active {
  color: var(--text);
  background: var(--surface-pressed);
  box-shadow:
    inset 4px 4px 9px var(--shadow-dark),
    inset -4px -4px 9px var(--shadow-light);
  transform: none;
}

.legend-color {
  width: 12px;
  height: 12px;
  background: var(--marker-color);
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--marker-color), transparent 78%);
}

.form,
.post-detail {
  background: var(--surface-raised);
  border: 1px solid color-mix(in srgb, var(--shadow-light), transparent 18%);
  border-radius: 8px;
  box-shadow:
    12px 12px 28px var(--shadow-dark),
    -12px -12px 28px var(--shadow-light);
}

.form {
  display: grid;
  gap: 20px;
  padding: 22px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

fieldset {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  padding: 0 6px;
  color: var(--text);
}

input,
textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--text);
  font: inherit;
  background: var(--input-bg);
  border: 0;
  border-radius: 8px;
  box-shadow:
    inset 5px 5px 11px var(--shadow-dark),
    inset -5px -5px 11px var(--shadow-light);
}

textarea {
  resize: vertical;
}

input[type="file"] {
  color: var(--muted);
}

.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 10px;
  color: var(--text);
  background: var(--surface-raised);
  border-radius: 8px;
  box-shadow:
    5px 5px 12px var(--shadow-dark),
    -5px -5px 12px var(--shadow-light);
}

.checkbox-item input {
  width: auto;
  accent-color: var(--accent);
  box-shadow: none;
}

.message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.post-detail {
  padding: 18px;
}
.post-detail p {
  margin: 0;
  color: var(--muted);
}

.caution-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.caution-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 12px;
  color: #0a3f86;
  font-size: 14px;
  font-weight: 800;
  background: #b8d9ff;
  border-radius: 999px;
}

.caution-chip:nth-child(2n) {
  color: #5d4200;
  background: #ffd45a;
}

.post-detail {
  display: grid;
  gap: 12px;
}

.post-body {
  padding: 18px;
  color: var(--text) !important;
  font-size: 20px;
  font-weight: 700;
  white-space: pre-wrap;
  background: color-mix(in srgb, var(--accent-soft), transparent 34%);
  border-radius: 8px;
}

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

.post-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow:
    7px 7px 15px var(--shadow-dark),
    -7px -7px 15px var(--shadow-light);
}

.post-photo-button {
  display: block;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
}

.post-photo-button:hover,
.post-photo-button:active {
  box-shadow: none;
  transform: none;
}

.photo-dialog {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  width: min(100%, var(--app-width));
  margin: 0 auto;
  padding: 54px 14px 28px;
  background: rgb(0 0 0 / 88%);
}

.photo-dialog[hidden] {
  display: none;
}

.photo-dialog-image {
  width: 100%;
  max-height: calc(100dvh - 96px);
  object-fit: contain;
  border-radius: 8px;
}

.photo-dialog-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  width: 42px;
  min-height: 42px;
  padding: 0;
  color: #ffffff;
  font-size: 32px;
  line-height: 1;
  background: rgb(255 255 255 / 16%);
  border-radius: 50%;
  box-shadow: none;
}

body.has-photo-dialog {
  overflow: hidden;
}

  body {
    background: #ffffff;
  }

  .site-header {
    width: 100%;
    margin: 0;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
    background: color-mix(in srgb, #ffffff, transparent 4%);
    border: 0;
    border-bottom: 1px solid #e6e8eb;
    border-radius: 0;
    box-shadow: 0 8px 22px rgb(15 23 42 / 8%);
  }

  .header-actions {
    flex: 0 0 auto;
    justify-content: space-between;
  }

  .site-nav {
    position: fixed;
    right: max(14px, calc((100vw - var(--app-width)) / 2 + 14px));
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: max(14px, calc((100vw - var(--app-width)) / 2 + 14px));
    z-index: 800;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
    background: color-mix(in srgb, #ffffff, transparent 4%);
    border: 1px solid #e1e5ea;
    border-radius: 24px;
    box-shadow: 0 16px 34px rgb(15 23 42 / 18%);
    backdrop-filter: blur(16px);
  }

  .site-nav a {
    min-width: 0;
    min-height: 48px;
    padding: 11px 8px;
    color: #5b6471;
    border-radius: 16px;
  }

  .site-nav a:hover {
    background: #eef5ff;
    box-shadow: none;
  }

  .page {
    width: 100%;
    padding: 20px 16px calc(94px + env(safe-area-inset-bottom));
  }

  .page-heading {
    align-items: center;
    margin-bottom: 18px;
  }

  .page-heading h1 {
    font-size: 22px;
  }

  .site-title {
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
  }

  .site-subtitle {
    max-width: 190px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-logo {
    width: 36px;
    height: 36px;
    margin-right: 9px;
    font-size: 18px;
    border-radius: 10px;
  }

  .button,
  button {
    min-height: 48px;
    padding: 11px 16px;
  }

  .form,
  .post-detail {
    border: 1px solid #e5e9ef;
    box-shadow: 0 12px 30px rgb(15 23 42 / 8%);
  }

  .form {
    gap: 18px;
    padding: 16px;
  }

  input,
  textarea {
    min-height: 48px;
    box-shadow: inset 0 0 0 1px #d9e1ec;
  }

  textarea {
    min-height: 116px;
  }

  fieldset {
    padding: 0;
    border: 0;
  }

  legend {
    padding: 0;
    margin-bottom: 8px;
  }

  .checkbox-list,
  .map-legend {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .checkbox-item,
  .legend-item {
    justify-content: center;
    min-height: 58px;
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #d7dde6;
    box-shadow: 0 6px 18px rgb(15 23 42 / 8%);
  }

  .checkbox-item:has(input:checked),
  .legend-item.is-active {
    color: #0f63d8;
    background: #eef5ff;
    border-color: #0f63d8;
    box-shadow: inset 0 0 0 1px #0f63d8;
  }

  .post-form-page .page-heading {
    position: sticky;
    top: 0;
    z-index: 400;
    margin: -20px -16px 18px;
    padding: 12px 16px;
    background: color-mix(in srgb, #ffffff, transparent 2%);
    border-bottom: 1px solid #e6e8eb;
  }

  .map-page {
    position: relative;
    height: calc(100dvh - 65px);
    padding: 0;
  }

  body:has(.map-page) .site-nav {
    display: none;
  }

  body:has(.post-form-page) .site-nav {
    display: none;
  }

  body:has(.post-detail-page) .site-nav {
    display: none;
  }

  .map-page .page-heading {
    position: fixed;
    right: max(16px, calc((100vw - var(--app-width)) / 2 + 16px));
    bottom: calc(126px + env(safe-area-inset-bottom));
    z-index: 1100;
    margin: 0;
    pointer-events: none;
  }

  .map-page .page-heading h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .map-page .page-heading .button {
    width: 78px;
    height: 78px;
    padding: 0 10px;
    font-size: 42px;
    line-height: 1;
    text-align: center;
    border-radius: 50%;
    box-shadow: 0 16px 28px rgb(15 99 216 / 28%);
    pointer-events: auto;
    touch-action: manipulation;
  }

  .map {
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .map-legend {
    position: absolute;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 16px;
    z-index: 700;
    margin: 0;
    padding: 10px;
    background: color-mix(in srgb, #ffffff, transparent 3%);
    border: 1px solid #e1e5ea;
    border-radius: 24px;
    box-shadow: 0 16px 34px rgb(15 23 42 / 18%);
    backdrop-filter: blur(16px);
  }

  .map-page .message {
    position: absolute;
    right: 16px;
    bottom: calc(156px + env(safe-area-inset-bottom));
    left: 16px;
    z-index: 700;
    margin: 0;
    text-align: center;
  }

  .post-detail {
    padding: 16px;
  }

  .post-body {
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .post-photo {
    border-radius: 8px;
    box-shadow: none;
  }
