/* 어르신·보호자 모바일 앱 */
body.app { background: var(--bg); }
#phone { max-width: 440px; margin: 0 auto; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); position: relative; overflow: hidden; }
body.framed { background: #E4E1D9; }
body.framed #phone { height: min(900px, calc(100vh - 40px)); margin: 20px auto; border: 1px solid #CFCAC0; border-radius: 34px; box-shadow: 0 30px 80px rgba(40,35,25,.18); }
#screen { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
#nav { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); }
#nav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); padding: 4px 0; }
#nav button .icon { width: 24px; height: 24px; }
#nav button.on { color: var(--primary); font-weight: 700; }

#demobar { flex: none; background: #2A2926; color: #D8D4CB; font-size: 12px; padding: 6px 12px; display: flex; align-items: center; gap: 8px; }
#demobar b { color: #fff; }
#demobar button { border: 1px solid #55524B; background: transparent; color: #EDEAE3; border-radius: 7px; padding: 2px 8px; font-size: 12px; }
#demobar .sp { flex: 1; }

.topbar { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 14px 16px; min-height: 60px; }
.topbar h1 { font-size: 19px; margin: 0; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .iconbtn { border: 0; background: none; padding: 6px; border-radius: 10px; color: var(--text); display: inline-flex; position: relative; }
.topbar .pill { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.badge-dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

.body { padding: 16px; }
.body > * + * { margin-top: 14px; }
.sec-title { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 10px; }
.sec-title h2 { font-size: 17px; margin: 0; }
.sec-title a, .sec-title button.link { font-size: 14px; font-weight: 600; color: var(--primary); background: none; border: 0; text-decoration: none; }

.pcard .name { font-size: 22px; font-weight: 800; }
.pcard .meta { color: var(--muted); font-size: 14px; }
.kv { display: grid; grid-template-columns: 72px 1fr; gap: 8px 10px; align-items: center; margin-top: 12px; font-size: 14px; }
.kv > span:nth-child(odd) { color: var(--muted); }

.medcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: block; width: 100%; text-align: left; }
.medcard + .medcard { margin-top: 10px; }
.medcard .t { font-size: 17px; font-weight: 700; }
.medcard .inn { color: var(--muted); font-size: 14px; margin-top: 2px; }
.medcard .bt { display: flex; justify-content: space-between; margin-top: 8px; font-size: 14px; }
.low { color: var(--danger); font-weight: 600; }

.slots { display: flex; gap: 8px; flex-wrap: wrap; }
.slot { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.slot.done { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }

.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--muted); }
.notice .icon { margin-top: 1px; }
.notice.primary { background: var(--primary-weak); border-color: #C6DCD8; color: var(--primary-2); }

.option { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.option .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-weak); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.option .ic .icon { width: 28px; height: 28px; }
.option b { font-size: 17px; display: block; }
.option small { color: var(--muted); font-size: 14px; }
.option.sel { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }

.qr-wrap { text-align: center; }
.qr-wrap .qr-box { width: 280px; max-width: 100%; }
.timer { font-family: var(--mono); font-size: 44px; font-weight: 600; letter-spacing: 1px; margin-top: 14px; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14px; color: var(--muted); }

.stepper { display: flex; gap: 8px; align-items: center; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 14px; }
.stepper span { padding: 6px 12px; border-radius: 999px; background: var(--bg-2); color: var(--muted); font-weight: 600; }
.stepper span.on { background: var(--primary); color: #fff; }
.stepper i { color: var(--faint); font-style: normal; }
.raw { background: var(--bg); border-radius: 10px; padding: 8px 12px; font-family: var(--mono); font-size: 13px; letter-spacing: .5px; margin: 10px 0; color: var(--muted); }
.rx-photo { width: 120px; height: 120px; border: 2px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; background: var(--bg-2); flex: none; overflow: hidden; }
.rx-photo img { width: 100%; height: 100%; object-fit: cover; }
.rx-sample { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; font-size: 13px; line-height: 1.7; }
.rx-sample .h { text-align: center; font-weight: 800; letter-spacing: 6px; border-bottom: 2px solid #333; padding-bottom: 6px; margin-bottom: 8px; }
.blur { filter: blur(1.2px); }

.gcard .head { display: flex; gap: 12px; align-items: center; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-2); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.permrow { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 15px; }
.visrow { padding: 12px 0; border-top: 1px solid var(--line-2); }
.visrow .seg { margin-top: 8px; }

.loglist .it { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.loglist .it:last-child { border-bottom: 0; }

.toggle { position: relative; width: 46px; height: 28px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: #CFCBC2; border-radius: 14px; transition: .2s; }
.toggle span::after { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--primary); }
.toggle input:checked + span::after { transform: translateX(18px); }

.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty .icon { width: 44px; height: 44px; color: var(--faint); }

/* ---------- 쉬운 모드 ---------- */
body.easy #screen { font-size: 19px; }
.easy-hello { font-size: 30px; font-weight: 800; line-height: 1.3; }
.easy-sub { font-size: 19px; color: var(--muted); margin-top: 4px; }
.bigbtn { width: 100%; border-radius: 24px; padding: 26px 22px; text-align: left; display: flex; align-items: center; gap: 18px; border: 2px solid var(--line); background: var(--surface); }
.bigbtn .icon { width: 46px; height: 46px; flex: none; }
.bigbtn b { font-size: 25px; display: block; line-height: 1.25; }
.bigbtn small { font-size: 17px; color: var(--muted); display: block; margin-top: 4px; }
.bigbtn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.bigbtn.primary small { color: #D6E6E3; }
.bigbtn.done { background: var(--ok-bg); border-color: var(--ok-line); }
.easy-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.easy-row .btn { padding: 18px 10px; font-size: 19px; border-radius: 18px; flex-direction: column; gap: 6px; }
.easy-row .btn .icon { width: 30px; height: 30px; }
.slotcard { background: var(--surface); border: 2px solid var(--line); border-radius: 22px; padding: 20px; }
.slotcard.done { border-color: var(--ok-line); background: var(--ok-bg); }
.slotcard h3 { font-size: 26px; margin: 0 0 6px; }
.slotcard .names { color: var(--muted); font-size: 18px; margin-bottom: 14px; }
.slotcard .btn { font-size: 22px; padding: 16px; border-radius: 16px; }
body.easy .qr-wrap .qr-box { width: 330px; }
body.easy .timer { font-size: 30px; }
.voicebtn { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--primary); color: var(--primary); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 16px; }

.banner { display: flex; gap: 12px; align-items: center; background: #FFF8E6; border: 1px solid var(--warn-line); color: #5E4810; border-radius: 16px; padding: 12px 14px; font-size: 15px; }
.banner button { margin-left: auto; }
