* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Malgun Gothic", "Noto Sans KR", sans-serif;
  display: flex; flex-direction: column;
  background: #f4f6f9; color: #1f2937;
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: #2563eb; color: #fff;
  gap: 8px; flex-wrap: wrap;
}
.status-line { display: flex; gap: 10px; align-items: center; font-weight: 600; }
#st-battery { font-size: 1.1em; }
#st-battery.low { color: #fecaca; }
#st-age { font-weight: 400; font-size: .9em; opacity: .9; }
#st-age.stale { color: #fde68a; font-weight: 700; }
.topbar-actions { display: flex; gap: 6px; }

.chip {
  border: 0; border-radius: 16px; padding: 6px 12px; font-size: .9em;
  background: rgba(255,255,255,.2); color: inherit; text-decoration: none;
  cursor: pointer;
}
.datebar .chip { background: #e5e7eb; color: #1f2937; }
.datebar .chip-active { background: #2563eb; color: #fff; }

.datebar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: #fff; border-bottom: 1px solid #e5e7eb;
}
.datebar input[type=date] { padding: 5px 8px; border: 1px solid #d1d5db; border-radius: 8px; font-size: .95em; }
.muted { color: #6b7280; font-size: .85em; }

#map { flex: 1; min-height: 300px; }
#map-fallback { flex: 1; display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; gap: 12px; padding: 20px; }

.night-fab {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: #7c3aed; color: #fff; border: 0; border-radius: 24px;
  padding: 13px 22px; font-size: 1em; font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,.3); cursor: pointer; z-index: 50;
}

.panel {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; justify-content: center; align-items: flex-end;
}
.panel-inner {
  background: #fff; width: 100%; max-width: 480px; max-height: 88vh;
  overflow-y: auto; border-radius: 16px 16px 0 0; padding: 18px;
}
.panel-inner h2 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.panel-inner h2 .chip { background: #e5e7eb; }
.panel-inner h3 { margin: 16px 0 6px; font-size: .95em; color: #2563eb; }
.row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px solid #f3f4f6; gap: 10px;
}
.row input[type=number], .row input[type=time] {
  width: 110px; padding: 7px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 1em; text-align: right;
}
.row input[type=checkbox] { width: 22px; height: 22px; }
.row.big span { font-weight: 700; }
.primary {
  width: 100%; margin-top: 16px; padding: 13px; border: 0; border-radius: 10px;
  background: #2563eb; color: #fff; font-size: 1.05em; font-weight: 700; cursor: pointer;
}

/* 로그인 */
.login-body { justify-content: center; align-items: center; }
.login-box {
  background: #fff; padding: 28px; border-radius: 16px; width: 90%; max-width: 340px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.login-box h1 { font-size: 1.3em; text-align: center; color: #2563eb; }
.login-box input { padding: 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 1em; }
.login-box button { padding: 13px; border: 0; border-radius: 10px; background: #2563eb; color: #fff; font-size: 1.05em; font-weight: 700; cursor: pointer; }
.error { color: #dc2626; font-size: .9em; text-align: center; }
