:root {
  color: #111111;
  background: #ffffff;
  font-family: -apple-system, "Apple SD Gothic Neo", "Pretendard", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  /* 더블탭 확대 차단 + 당겨서 새로고침/고무줄 스크롤 차단 */
  touch-action: manipulation;
  overscroll-behavior: none;
}

body {
  background: #ffffff;
}

#map {
  position: relative;
  background: #ffffff;
}

#network {
  position: absolute;
  z-index: 650;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.title-block {
  position: absolute;
  z-index: 1000;
  top: 18px;
  left: 20px;
  pointer-events: none;
}

.title-block h1,
.title-block p {
  margin: 0;
}

.title-block h1 {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.title-block p {
  margin-top: 2px;
  color: #999999;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
}

.title-block .selected-line {
  min-height: 15px;
  color: #111111;
}

.meeting-panel {
  position: fixed;
  z-index: 1100;
  top: 18px;
  right: 18px;
  width: min(240px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #111111;
  background: #ffffff;
  color: #111111;
  font-size: 11px;
  line-height: 1.4;
  overscroll-behavior: contain;
}

.meeting-panel button,
.meeting-panel input {
  border-radius: 0;
  color: inherit;
  font: inherit;
}

.meeting-panel button {
  cursor: pointer;
}

.meeting-panel__header h2,
.meeting-panel__header p {
  margin: 0;
}

.meeting-panel__header h2 {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.meeting-panel__header p {
  margin-top: 2px;
  color: #999999;
  font-size: 10px;
}

.meeting-form {
  margin-top: 12px;
}

.meeting-people {
  display: grid;
  gap: 6px;
}

.meeting-person {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr) 14px;
  gap: 5px;
  align-items: center;
}

.meeting-station-wrap {
  position: relative;
  min-width: 0;
}

.meeting-suggest {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 156px;
  overflow-y: auto;
  border: 1px solid #111111;
  border-top: 0;
  background: #ffffff;
}

.meeting-suggest[hidden] {
  display: none;
}

.meeting-suggest__item {
  display: block;
  width: 100%;
  padding: 6px 6px;
  border: 0;
  background: #ffffff;
  text-align: left;
  font-size: 11px;
}

.meeting-suggest__item:hover,
.meeting-suggest__item:active {
  background: #111111;
  color: #ffffff;
}

.meeting-input {
  width: 100%;
  height: 27px;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid #c8c8c8;
  outline: none;
  background: #ffffff;
  font-size: 11px;
}

.meeting-input::placeholder {
  color: #999999;
  opacity: 1;
}

.meeting-input:focus {
  border-color: #111111;
}

.meeting-input.is-invalid {
  border: 1px solid #c7402d;
}

.meeting-remove {
  width: 14px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #777777;
  font-size: 15px;
  line-height: 24px;
  text-align: center;
}

.meeting-remove:hover,
.meeting-remove:active {
  color: #111111;
}

.meeting-remove[hidden],
.meeting-add[hidden],
.meeting-results[hidden] {
  display: none;
}

.meeting-text-button {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 10px;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.meeting-add {
  display: block;
  margin-top: 7px;
}

.meeting-submit {
  display: block;
  width: 100%;
  height: 30px;
  margin-top: 10px;
  padding: 4px 8px;
  border: 1px solid #111111;
  background: #ffffff;
  font-size: 11px;
  font-weight: 500;
}

.meeting-submit:hover:not(:disabled),
.meeting-submit:active:not(:disabled) {
  background: #111111;
  color: #ffffff;
}

.meeting-submit:disabled {
  cursor: wait;
  color: #999999;
}

.meeting-panel button:focus-visible,
.meeting-panel input:focus-visible {
  outline: 1px solid #2b54a3;
  outline-offset: 2px;
}

.meeting-results {
  margin-top: 12px;
  border-top: 1px solid #111111;
}

.meeting-results__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0 3px;
  font-size: 10px;
  font-weight: 600;
}

.meeting-results__actions {
  display: flex;
  gap: 10px;
}

.meeting-clear,
.meeting-edit {
  font-weight: 400;
}

.meeting-edit {
  display: none;
}

/* 모바일: 결과가 나오면 폼을 접어 지도를 확보한다 */
.meeting-panel.is-collapsed .meeting-form,
.meeting-panel.is-collapsed .meeting-panel__header p {
  display: none;
}

.meeting-panel.is-collapsed .meeting-results {
  margin-top: 8px;
}

.meeting-panel.is-collapsed .meeting-edit {
  display: inline;
}

.meeting-candidates {
  border-bottom: 1px solid #dddddd;
}

.meeting-candidate {
  display: block;
  width: 100%;
  padding: 7px 0;
  border: 0;
  border-top: 1px solid #dddddd;
  background: #ffffff;
  text-align: left;
}

.meeting-candidate__summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.meeting-candidate__name {
  font-size: 12px;
  font-weight: 600;
}

.meeting-candidate__worst {
  flex: none;
  color: #999999;
  font-size: 10px;
  font-weight: 400;
}

.meeting-candidate__legs {
  display: grid;
  gap: 1px;
  margin-top: 5px;
  color: #555555;
  font-size: 10px;
}

.meeting-candidate:hover .meeting-candidate__name,
.meeting-candidate.is-selected .meeting-candidate__name {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.meeting-empty {
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid #dddddd;
  color: #999999;
  font-size: 10px;
}

.leaflet-container {
  background: #ffffff;
  font-family: -apple-system, "Apple SD Gothic Neo", "Pretendard", sans-serif;
}

.leaflet-control-attribution {
  margin: 0 0 3px 4px !important;
  padding: 0 !important;
  color: #999999;
  background: transparent !important;
  font-size: 8px;
  line-height: 1.2;
}

.leaflet-control-attribution a {
  color: #777777;
}

@media (max-width: 520px) {
  .title-block {
    top: 14px;
    left: 14px;
  }

  .meeting-panel {
    top: auto;
    bottom: 14px;
    right: 14px;
    width: min(260px, calc(100vw - 28px));
    max-height: min(55vh, calc(100vh - 28px));
  }

  /* 16px 미만이면 iOS/안드로이드가 입력 포커스 시 화면을 확대해버린다 */
  .meeting-input,
  .meeting-suggest__item {
    height: 34px;
    font-size: 16px;
  }

  .meeting-suggest__item {
    height: auto;
    padding: 8px 6px;
  }

  .meeting-submit {
    height: 38px;
    font-size: 14px;
  }

  .meeting-candidate__name {
    font-size: 14px;
  }

  .meeting-candidate__legs {
    font-size: 12px;
  }
}
