* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Arial, sans-serif;
  color: #1f2933;
  background: #eef3f1;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: white;
  border-bottom: 1px solid #d7e0dc;
}

.languagePicker {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  border: 1px solid #d7e0dc;
  border-radius: 999px;
  color: #51615d;
  background: #f8faf9;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.languagePicker select {
  width: 112px;
  min-width: 0;
  margin: 0;
  padding: 7px 32px 7px 11px;
  border: 1px solid #c5d0cc;
  border-radius: 999px;
  color: #0f766e;
  background:
    linear-gradient(45deg, transparent 50%, #0f766e 50%) calc(100% - 16px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, #0f766e 50%, transparent 50%) calc(100% - 11px) 50% / 6px 6px no-repeat,
    white;
  font-weight: 800;
  appearance: none;
}

.languagePicker select:focus {
  outline: 3px solid rgba(15, 118, 110, 0.16);
  border-color: #0f766e;
}

header p {
  margin: 0 0 4px;
  color: #0f766e;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

main {
  display: grid;
  grid-template-columns: 1fr 380px;
  min-height: calc(100vh - 121px);
  width: 100%;
  min-width: 0;
}

.mapBox {
  position: relative;
  padding: 18px;
  min-width: 0;
}

#map {
  width: 100%;
  height: calc(100vh - 157px);
  min-height: 520px;
  border: 2px solid #b9c8c1;
  border-radius: 12px;
  overflow: hidden;
}

/* Leaflet's layout must exist even if the CDN stylesheet loads late or fails. */
.leaflet-container {
  position: relative;
  overflow: hidden;
  touch-action: none;
  background: #ddd;
  outline-offset: 1px;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-pane {
  z-index: 400;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-map-pane canvas {
  z-index: 100;
}

.leaflet-map-pane svg {
  z-index: 200;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  width: 256px;
  height: 256px;
  filter: inherit;
  visibility: inherit;
  border: 0;
}

.leaflet-safari .leaflet-tile {
  image-rendering: -webkit-optimize-contrast;
}

.leaflet-zoom-animated {
  transform-origin: 0 0;
}

.leaflet-interactive {
  cursor: pointer;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: visiblePainted;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control {
  float: left;
  clear: both;
}

.leaflet-right .leaflet-control {
  float: right;
}

.leaflet-top .leaflet-control {
  margin-top: 10px;
}

.leaflet-bottom .leaflet-control {
  margin-bottom: 10px;
}

.leaflet-left .leaflet-control {
  margin-left: 10px;
}

.leaflet-right .leaflet-control {
  margin-right: 10px;
}

.leaflet-control-zoom a {
  display: block;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-bottom: 1px solid #ccc;
  color: #000;
  background: #fff;
  line-height: 30px;
  text-align: center;
  text-decoration: none;
}

.leaflet-popup {
  position: absolute;
  text-align: center;
}

.leaflet-popup-content-wrapper {
  padding: 1px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.25);
}

.leaflet-popup-content {
  margin: 12px;
  min-width: 180px;
  text-align: left;
}

.mapPopup strong {
  display: block;
  margin-bottom: 4px;
}

.mapPopup p {
  margin: 8px 0;
}

.mapInfo {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 900;
  width: min(320px, calc(100% - 68px));
  padding: 14px;
  border: 1px solid #c8d4cf;
  border-radius: 10px;
  background: white;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, calc(-100% - 50px));
}

.mapInfo::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 18px;
  height: 18px;
  background: white;
  border-right: 1px solid #c8d4cf;
  border-bottom: 1px solid #c8d4cf;
  transform: translateX(-50%) rotate(45deg);
}

.mapInfo.hidden {
  display: none;
}

.mapInfo .closeInfo {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  color: #1f2933;
  background: #e2e8e4;
}

.mapInfo .inlineAction {
  width: auto;
  min-height: 30px;
  padding: 6px 9px;
  font-size: 13px;
  border-radius: 7px;
}

.mapInfo .photoToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.leaflet-popup-tip-container {
  width: 40px;
  height: 20px;
  position: absolute;
  left: 50%;
  margin-left: -20px;
  overflow: hidden;
  pointer-events: none;
}

.leaflet-popup-tip {
  width: 17px;
  height: 17px;
  margin: -10px auto 0;
  padding: 1px;
  transform: rotate(45deg);
  background: white;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.25);
}

.leaflet-popup-close-button {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 4px 0 0;
  color: #757575;
  text-decoration: none;
  text-align: center;
  width: 20px;
  height: 20px;
}

.leaflet-popup-content button {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: #0f766e;
  font: inherit;
  font-weight: 700;
  margin-top: 8px;
}

.leaflet-container img {
  max-width: none;
}

aside {
  overflow: auto;
  padding: 18px;
  background: #f8faf9;
  border-left: 1px solid #d7e0dc;
  min-width: 0;
}

footer {
  padding: 12px 18px;
  border-top: 1px solid #d7e0dc;
  color: #66746f;
  background: white;
  font-size: 13px;
  text-align: center;
}

.footerLink {
  width: auto;
  margin-left: 10px;
  padding: 0;
  border: 0;
  color: #0f766e;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.footerLink:hover {
  background: transparent;
  color: #0b5f59;
}

.privacyContent {
  max-width: 680px;
}

.privacyContent h2,
.privacyContent h3 {
  margin: 0 0 10px;
}

.privacyContent h3 {
  margin-top: 18px;
  font-size: 16px;
}

.privacyContent p {
  line-height: 1.5;
}

.privacyContent button {
  margin-top: 10px;
}

.adSection {
  width: 100%;
  max-width: 100%;
  margin-top: 12px;
  min-height: 106px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: 1px solid #d7e0dc;
  border-radius: 10px;
  background: #f8faf9;
}

.kakao_ad_area {
  max-width: 100%;
}

.desktopAd,
.desktopAd .kakao_ad_area {
  width: 728px;
  height: 90px;
}

.mobileAd,
.mobileAd .kakao_ad_area {
  width: 320px;
  height: 100px;
}

.mobileAd {
  display: none !important;
}

.panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #d7e0dc;
  border-radius: 10px;
  background: white;
}

.atmListPanel {
  display: flex;
  flex-direction: column;
  max-height: min(460px, 48vh);
}

#atmList {
  overflow: auto;
  padding-right: 4px;
}

.panel:first-child {
  border-color: #0f766e;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.12);
}

.adminPanel {
  margin-top: 28px;
  opacity: 0.82;
}

.adminPanel:hover,
.adminPanel:focus-within {
  opacity: 1;
}

aside input,
aside textarea,
aside select,
aside button,
dialog input,
dialog textarea,
dialog select,
dialog button,
header button {
  width: 100%;
  font: inherit;
}

aside input,
aside textarea,
aside select,
dialog input,
dialog textarea,
dialog select {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #c5d0cc;
  border-radius: 8px;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

aside button,
dialog button,
header button {
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: #0f766e;
  font-weight: 700;
  cursor: pointer;
}

aside button:hover,
dialog button:hover,
header button:hover {
  background: #0b5f59;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.check input {
  width: auto;
  margin: 0;
}

.fieldLabel {
  display: block;
  margin: 12px 0 6px;
  color: #66746f;
  font-size: 13px;
  font-weight: 700;
}

.atmItem,
.reportItem {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #d7e0dc;
  border-radius: 8px;
  background: #fbfdfc;
}

.atmItem {
  text-align: left;
  color: #1f2933;
  background: white;
}

.atmItem.selected {
  border-color: #0f766e;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.12);
}

.atmItem strong,
.detail strong {
  display: block;
  margin-bottom: 4px;
}

.atmExpanded {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #d7e0dc;
}

.atmExpanded p {
  margin: 0 0 8px;
}

.atmPhoto {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  margin: 10px 0;
  border: 1px solid #d7e0dc;
  border-radius: 8px;
}

.photoPreview {
  margin-top: 8px;
}

.photoPreview img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border: 1px solid #d7e0dc;
  border-radius: 8px;
}

.inlineAction {
  display: inline-block;
  width: auto;
  margin-top: 4px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: #0f766e;
  font: inherit;
  font-weight: 700;
}

.photoToggle {
  margin-bottom: 4px;
}

.muted {
  color: #66746f;
  font-size: 14px;
}

.fee {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  color: white;
  background: #c2410c;
  font-size: 13px;
  font-weight: 800;
}

.fee.free {
  background: #15803d;
}

.fee.unknown {
  background: #64748b;
}

.detail button {
  margin-top: 10px;
}

.reportActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.secondaryButton {
  color: #1f2933;
  background: #e2e8e4;
}

.secondaryButton:hover {
  background: #d2ddd8;
}

.empty {
  color: #66746f;
}

dialog {
  width: min(560px, calc(100vw - 24px));
  border: 0;
  border-radius: 12px;
  padding: 18px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

dialog label {
  display: block;
  margin-top: 10px;
  font-weight: 700;
}

dialog label input,
dialog label textarea {
  margin-top: 6px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.formError {
  min-height: 20px;
  margin: 10px 0 0;
  color: #b42318;
  font-size: 14px;
  font-weight: 700;
}

.actions button {
  background: #52615d;
}

.actions #saveButton {
  background: #0f766e;
}

.actions .danger {
  background: #b42318;
}

@media (max-width: 850px) {
  header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  h1 {
    font-size: 21px;
    line-height: 1.2;
  }

  .languagePicker {
    width: 100%;
    justify-content: space-between;
    border-radius: 10px;
  }

  main {
    grid-template-columns: 1fr;
    min-height: auto;
    overflow-x: hidden;
  }

  .mapBox {
    padding: 12px;
    overflow: hidden;
  }

  #map {
    height: 56vh;
    min-height: 360px;
    border-radius: 10px;
  }

  aside {
    overflow: visible;
    padding: 12px;
    border-left: 0;
    border-top: 1px solid #d7e0dc;
  }

  .panel {
    padding: 14px;
    margin-bottom: 12px;
  }

  .atmListPanel {
    max-height: 52vh;
  }

  .mapInfo {
    width: min(300px, calc(100vw - 40px));
    max-height: 42vh;
    overflow: auto;
  }

  .adSection {
    min-height: 116px;
    padding: 6px;
    overflow-x: hidden;
    overflow-y: hidden;
  }

  .desktopAd {
    display: none !important;
  }

  .mobileAd {
    display: block !important;
    max-width: 100%;
  }

  dialog {
    max-height: calc(100vh - 24px);
    overflow: auto;
  }

  .actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  header p {
    font-size: 13px;
  }

  h1 {
    font-size: 19px;
  }

  .languagePicker {
    grid-template-columns: 1fr auto;
    font-size: 13px;
  }

  .languagePicker select {
    width: 104px;
  }

  #map {
    height: 50vh;
    min-height: 320px;
  }

  .atmListPanel {
    max-height: 48vh;
  }

  .reportActions {
    grid-template-columns: 1fr;
  }

  aside input,
  aside textarea,
  aside select,
  aside button,
  dialog input,
  dialog textarea,
  dialog select,
  dialog button,
  header select {
    font-size: 16px;
  }

  .adSection {
    align-items: flex-start;
  }

  footer {
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.4;
  }
}
