/* 난지 빈자리 웹앱. 색은 안드로이드 앱(ui/Theme.kt)과 같다: 숲 초록·모래·크림, 밤 모드는 body.night */
:root {
  --primary: #2E6B4F; --on-primary: #fff; --primary-c: #D3E8DA; --on-primary-c: #173A2B;
  --sand: #F1E5CF; --on-sand: #3B2A12;
  --bg: #F6F4EE; --card: #fff; --text: #1B1F1C; --muted: #5B635E; --outline: #BFC8C1; --line: #E2E6E1;
  --error: #B3261E; --green: #1B7F3B; --orange: #FF8A00;
  --radius: 22px;
}
body.night {
  --primary: #8FD3A8; --on-primary: #00391F; --primary-c: #1F4D3A; --on-primary-c: #D3E8DA;
  --sand: #3A3122; --on-sand: #F1E5CF;
  --bg: #0F1411; --card: #1E2621; --text: #E2E8E3; --muted: #A9B5AD; --outline: #46524B; --line: #2C3530;
  --error: #F2B8B5; --green: #7BD88F;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px; line-height: 1.45;
  padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 24px);
  max-width: 640px; margin: 0 auto;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--error); }

/* 머리 */
.top { display: flex; align-items: center; gap: 4px; padding: 14px 0 6px; }
.logo { width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex: none; }
.logo img { width: 100%; height: 100%; display: block; }
.brand { flex: 1; margin-left: 8px; min-width: 0; }
.brand h1 { font-size: 21px; margin: 0; line-height: 1.2; }
.brand p { margin: 0; font-size: 12px; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.icon-btn:active { background: var(--line); }
.icon-btn svg { width: 24px; height: 24px; fill: var(--text); }
.badge {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

/* 카드 */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin: 12px 0; }
body:not(.night) .card { box-shadow: 0 1px 2px rgba(23,58,43,.06); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.headline { font-size: 18px; font-weight: 700; }
.stack > * + * { margin-top: 6px; }

/* 알림 켜기 안내 */
.notice { background: var(--primary-c); color: var(--on-primary-c); }
.notice b { display: block; margin-bottom: 4px; }

/* 스위치 */
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--line); border: 2px solid var(--outline); transition: .2s; }
.switch span::after {
  content: ""; position: absolute; width: 16px; height: 16px; left: 6px; top: 6px; border-radius: 50%;
  background: var(--outline); transition: .2s;
}
.switch input:checked + span { background: var(--primary); border-color: var(--primary); }
.switch input:checked + span::after { left: 24px; top: 2px; width: 24px; height: 24px; background: var(--on-primary); }
.switch input:disabled + span { opacity: .5; }

/* 버튼 */
.btn { padding: 10px 18px; border-radius: 22px; font-weight: 600; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.tonal { background: var(--sand); color: var(--on-sand); }
.btn.text { color: var(--primary); padding: 8px 12px; }
.btn.text.quiet { color: var(--muted); }
.btn:disabled { opacity: .5; }

/* 감시 항목 */
.section { display: flex; align-items: center; margin: 22px 0 4px; }
.section h2 { flex: 1; font-size: 18px; margin: 0; }
.watch.off { opacity: .6; }
.watch-title { font-size: 18px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { background: var(--sand); color: var(--on-sand); border-radius: 10px; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.summary { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.summary.open { color: var(--green); font-weight: 700; }
.summary .dot { width: 8px; height: 8px; background: var(--outline); }
.summary.open .dot { background: var(--green); }
.actions { display: flex; justify-content: flex-end; margin: 4px -8px -10px 0; }

/* 팝업 */
.backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center;
  z-index: 10; animation: fade .15s;
}
.sheet {
  background: var(--card); width: 100%; max-width: 640px; max-height: 86vh; overflow-y: auto;
  border-radius: 26px 26px 0 0; padding: 22px 20px calc(env(safe-area-inset-bottom) + 16px);
  animation: up .2s ease-out;
}
.sheet h3 { margin: 0 0 12px; font-size: 20px; }
.sheet .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.label { font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button { border: 1.5px solid var(--outline); border-radius: 10px; padding: 7px 12px; font-size: 14px; }
.pick button.on { background: var(--primary-c); color: var(--on-primary-c); border-color: var(--primary); font-weight: 700; }
input[type=password], input[type=text] {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--outline);
  background: var(--bg); color: var(--text);
}

/* 알림 기록 */
.ev { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev.seen { opacity: .45; }
.ev .when { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ev .when .dot { width: 8px; height: 8px; background: var(--orange); }
.ev .t { font-weight: 700; }
.ev.seen .t { font-weight: 400; }
.ev .t.vacancy { color: var(--green); }
.ev .t.bad { color: var(--error); }
.ev .b { font-size: 13px; color: var(--muted); white-space: pre-line; }

/* 로그인 */
.login { margin-top: 18vh; text-align: center; }
.login img { width: 84px; height: 84px; border-radius: 22px; }
.login h1 { margin: 14px 0 4px; }
.login form { margin-top: 24px; text-align: left; }
.login .btn { width: 100%; margin-top: 12px; padding: 13px; }
