/* 안심이동 웹 지도 화면의 모양을 정하는 스타일 */
:root {
  --ink: #1d2733;
  --muted: #5e6b7a;
  --line: #dde3ea;
  --surface: #ffffff;
  --page: #f3f5f8;
  --accent: #1763c6;
  --accent-ink: #ffffff;
  --moving: #0b7a4b;
  --moving-bg: #e2f5ec;
  --alert: #b3261e;
  --alert-bg: #fde8e6;
  --idle: #5e6b7a;
  --idle-bg: #eceff3;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
}
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }

input, textarea, button { font: inherit; color: inherit; }
input, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #b9c3cf;
  border-radius: 8px;
  background: var(--surface);
}
input:focus-visible, textarea:focus-visible, button:focus-visible, .person:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
textarea { resize: vertical; font-size: 13px; }
label { display: block; font-weight: 600; font-size: 13px; }
label input { margin-top: 4px; font-weight: 400; font-size: 15px; }

button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
.primary {
  padding: 9px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  white-space: nowrap;
}
.text-button {
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
}
.error { color: var(--alert); font-size: 13px; font-weight: 600; }
.error:empty { display: none; }
.hint { color: var(--muted); font-size: 13px; }

/* 처음 설정과 로그인 */
.gate { display: flex; min-height: 100%; align-items: center; justify-content: center; padding: 16px; }
.gate-card {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 380px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

/* 지도 화면 */
.app { display: grid; grid-template-columns: 370px 1fr; height: 100%; }
.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.map { min-height: 0; background: #dfe5ea; }
.refreshed { color: var(--muted); font-size: 12px; }
.banner {
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--alert-bg);
  color: var(--alert);
  font-size: 13px;
  font-weight: 600;
}

.people { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.people-empty { color: var(--muted); font-size: 14px; }
.person {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.person[data-clickable="true"] { cursor: pointer; }
.person[data-clickable="true"]:hover { border-color: #9fb0c3; }
.person[data-selected="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.person[data-state="stale"] { border-color: var(--alert); background: #fff8f7; }
.person-top { display: flex; align-items: center; gap: 8px; }
.person-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; }
.person-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 700; font-size: 16px; }
.chip { flex: none; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.chip-moving { background: var(--moving-bg); color: var(--moving); }
.chip-stale { background: var(--alert); color: #fff; }
.chip-idle { background: var(--idle-bg); color: var(--idle); }
.person-line { margin-top: 5px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.person-alert { margin-top: 6px; color: var(--alert); font-size: 14px; font-weight: 700; }
.person-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 7px; }

.invite-form { display: grid; gap: 7px; padding-top: 14px; border-top: 1px solid var(--line); }
.invite-row { display: flex; gap: 8px; }
.invite-row input { flex: 1; min-width: 0; }
.invite-result {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: #f2f7fe;
}
.invite-code { font: 700 25px/1.2 Consolas, "Courier New", monospace; letter-spacing: 2px; }
.invite-actions { display: flex; align-items: center; justify-content: space-between; }

.map-label {
  padding: 1px 7px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font: 700 12px/1.5 "Malgun Gothic", system-ui, sans-serif;
  box-shadow: none;
}
.map-label::before { display: none; }

@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 52vh auto; height: auto; min-height: 100%; }
  .map { order: -1; }
  .panel { border-top: 1px solid var(--line); border-right: 0; overflow: visible; }
}
