/* 🏢 사무소 운영장부 — 📱 폰 앱 껍데기 (v2.1) · 색은 PC 화면과 같게 */
:root {
  --navy: #1f3a5f; --navy2: #2c5282; --bg: #f5f6f8; --card: #fff; --line: #e2e6eb; --text: #18212c; --muted: #66727f;
  --bad: #c53030; --badbg: #fdecec; --topH: 48px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-text-size-adjust: 100%; overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: calc(var(--topH) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 6px 0; display: flex; align-items: center; gap: 4px;
  background: var(--navy); color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.top .ttl { flex: 1; min-width: 0; font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.ib { flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 10px; background: transparent; color: #fff; font-size: 19px; cursor: pointer; }
.ib:active { background: rgba(255, 255, 255, .16); }
.pill { flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .12); color: #fff; border-radius: 999px; padding: 5px 10px; font-size: 13px; cursor: pointer; white-space: nowrap; }

.stage { position: fixed; left: 0; right: 0; bottom: 0; top: calc(var(--topH) + env(safe-area-inset-top, 0px)); background: var(--bg); }
.stage iframe.scr { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); }

.menu {
  position: fixed; z-index: 30; right: 8px; top: calc(var(--topH) + env(safe-area-inset-top, 0px) + 4px); width: min(300px, calc(100vw - 16px));
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); padding: 8px;
}
.menu .small { padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.mi { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 11px 10px; border-radius: 8px; font-size: 15px; cursor: pointer; }
.mi:active { background: #eef2f7; }
.mi.bad { color: var(--bad); }

.pane { max-width: 560px; margin: 0 auto; padding: calc(var(--topH) + env(safe-area-inset-top, 0px) + 16px) 18px 30px; }
.pane h1 { font-size: 20px; color: var(--navy); margin: 0 0 12px; }
.pane ol { padding-left: 20px; margin: 6px 0 12px; }
.pane li { margin: 6px 0; }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #cfd6de; border-radius: 9px; background: #fff; font-size: 16px; }
.btn { min-height: 44px; border: 1px solid #c9d1da; background: #fff; border-radius: 9px; padding: 8px 14px; cursor: pointer; font-size: 15px; white-space: nowrap; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.note { padding: 10px 12px; border-radius: 9px; margin: 8px 0 12px; font-size: 14px; white-space: pre-wrap; }
.note.bad { background: var(--badbg); color: #842029; }

.busy { position: fixed; inset: 0; z-index: 40; background: rgba(245, 246, 248, .72); display: flex; align-items: center; justify-content: center; }
.busy .box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; box-shadow: 0 4px 18px rgba(0, 0, 0, .1); font-size: 15px; }
.spin { width: 18px; height: 18px; border: 2px solid #c8d3df; border-top-color: var(--navy); border-radius: 50%; display: inline-block; animation: sp .8s linear infinite; vertical-align: -4px; margin-right: 8px; }
@keyframes sp { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: 92vw; background: #18212c; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }

.ask { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; padding: 18px; }
.ask .box { background: #fff; border-radius: 14px; padding: 16px; width: min(420px, 100%); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.ask .msg { white-space: pre-wrap; font-size: 15px; margin-bottom: 14px; }
.ask .btns { display: flex; gap: 8px; justify-content: flex-end; }

/* 관리 패널에서만: 오른쪽 아래 [＋ 입력] → 자주 쓰는 화면 (패널 단추는 아래쪽에 있어서) */
.fab { position: fixed; z-index: 25; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 999px; background: var(--navy); color: #fff; padding: 12px 18px; font-size: 15px; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); cursor: pointer; }
.fab:active { transform: scale(.97); }
.quick { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .32); display: flex; align-items: flex-end; justify-content: center; }
.quick .qbox { background: #fff; width: min(480px, 100%); border-radius: 16px 16px 0 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 24px rgba(0, 0, 0, .18); }
.quick .mi { font-size: 16px; padding: 13px 12px; }

@media (prefers-color-scheme: dark) {
  :root { --bg: #111820; --line: #2a3542; --text: #e6ebf0; --muted: #9aa7b4; }
  .menu, .busy .box, .ask .box, .quick .qbox { background: #1a232d; color: var(--text); }
  .row input, .btn { background: #1a232d; border-color: #3a4756; color: var(--text); }
  .btn.primary { background: #3d6ea8; border-color: #3d6ea8; }
  .busy { background: rgba(17, 24, 32, .72); }
  .mi:active { background: #24303c; }
}
