/* 가람 — 디자인 토큰 (mockup screens.html에서 이식) */
:root {
  --acc: #2F6BED; --accd: #1B4DB3; --accl: #EAF0FE;
  --ink: #1A1D24; --mut: #6B7280; --hint: #9AA1AC; --line: #E8EAEE; --bg: #F6F7F9;
  --warn: #B45309; --warnbg: #FCF1E0; --warnln: #F2D9A8;
  --ok: #1D9E75; --okbg: #E1F5EE; --gray: #888780; --graybg: #F1EFE8; --danger: #C0392B;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: #fff; color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  /* align-items:flex-start — 앱 셸을 뷰포트 높이로 강제 stretch하지 않아야 콘텐츠만큼 자라며 스크롤됨 */
  display: flex; justify-content: center; align-items: flex-start;
}
/* 데스크톱(넓은 화면)에서만 가운데 카드처럼 보이도록 회색 프레임 */
@media (min-width: 480px) { body { background: #EDEFF2; } }
/* 앱 셸: 모바일은 꽉 채우고, 데스크톱은 가운데 카드.
   상·하단 안전영역(상태바·홈 인디케이터)까지 흰 배경을 채우고 패딩으로 가린다. */
.app {
  width: 100%; max-width: 440px; min-height: 100dvh; background: #fff;
  display: flex; flex-direction: column;
  padding: calc(22px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom));
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 헤더 / 로고 */
.logo { font-size: 26px; font-weight: 600; letter-spacing: -.5px; color: var(--acc); }
.tag { font-size: 14px; color: var(--mut); margin-top: 2px; }
.topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.topbar a { color: var(--mut); display: inline-flex; text-decoration: none; }
.topbar .title { font-size: 16px; font-weight: 600; }

/* 단계 카드 (랜딩) */
.step { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
.stepn { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--accl); color: var(--accd); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.stept { font-size: 14px; font-weight: 600; }
.steps { font-size: 12.5px; color: var(--mut); margin-top: 2px; line-height: 1.5; }

/* 버튼 */
.btn { width: 100%; border: none; border-radius: 13px; padding: 13px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn:disabled { opacity: .7; cursor: default; }
.bp { background: var(--acc); color: #fff; }
.bs { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.bd { background: #fff; color: var(--danger); border: 1px solid #EBC7C2; }
.col { display: flex; flex-direction: column; gap: 9px; }

/* 폼 */
.fg { margin-bottom: 13px; }
.fl { font-size: 12.5px; font-weight: 600; color: var(--ink); margin: 0 0 6px 2px; display: block; }
.fl .opt-hint { color: var(--hint); font-weight: 400; }
.fi { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; font-size: 14px; color: var(--ink); background: #fff; font-family: inherit; }
.fi.err { border-color: #E9A8A0; background: #FDF4F3; }
.fi::placeholder { color: var(--hint); }

/* 신뢰 안내 / 보안 박스 */
.trust { display: flex; gap: 7px; align-items: flex-start; font-size: 11.5px; color: var(--mut); line-height: 1.5; background: var(--bg); border-radius: 11px; padding: 10px 12px; }
.sb { display: flex; gap: 9px; align-items: flex-start; background: var(--accl); border-radius: 12px; padding: 11px 13px; font-size: 12px; color: var(--accd); line-height: 1.55; }

/* 알림 채널 옵션 (토글) */
.opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; margin-bottom: 9px; cursor: pointer; }
.opt.on { border-color: var(--acc); background: var(--accl); }
.opt .ot { font-size: 13.5px; font-weight: 600; }
.opt .os { font-size: 11.5px; color: var(--mut); }
.opt i { font-size: 18px; color: var(--mut); }
.opt.on i { color: var(--accd); }
.sw { flex: none; width: 42px; height: 25px; border-radius: 13px; background: #D7DAE0; position: relative; transition: .2s; cursor: pointer; }
.sw.on { background: var(--acc); }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: .2s; }
.sw.on::after { left: 20px; }

/* 에러 박스 / 체크박스 / 링크 */
.err-box { display: flex; gap: 8px; align-items: center; background: #FDF1EF; border: 1px solid #F0D4CF; border-radius: 11px; padding: 10px 12px; font-size: 12.5px; color: var(--danger); margin-bottom: 13px; line-height: 1.5; }
.link { text-align: center; font-size: 12.5px; color: var(--mut); margin-top: 16px; }
.link a { color: var(--acc); text-decoration: none; font-weight: 600; }
.note { font-size: 11.5px; color: var(--mut); text-align: center; margin: 10px 0 0; }
.chk { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink); margin: 2px 0 16px 2px; cursor: pointer; user-select: none; }
.cbox { width: 19px; height: 19px; border-radius: 6px; border: 1px solid var(--acc); background: var(--acc); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.chk.off .cbox { background: #fff; color: transparent; border-color: var(--line); }

.spin { width: 17px; height: 17px; border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; display: inline-block; vertical-align: -3px; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* 대시보드 */
.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: 13px; padding: 12px 13px; margin-bottom: 14px; line-height: 1.5; }
.bw { background: var(--warnbg); border: 1px solid var(--warnln); }
.bw i { font-size: 18px; color: var(--warn); margin-top: 1px; }
.bw .bt { font-size: 13px; font-weight: 600; color: var(--warn); }
.bw .bsub { font-size: 11.5px; color: #9A6A1E; margin-top: 2px; }
.bw .bsub a { color: #9A6A1E; text-decoration: underline; cursor: pointer; }
.hdr { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.av { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--accl); }
.hn { font-size: 16px; font-weight: 600; }
.hs { font-size: 12px; color: var(--mut); margin-top: 1px; }
.notif { display: flex; align-items: center; gap: 11px; background: var(--accl); border-radius: 13px; padding: 12px 13px; margin-bottom: 8px; cursor: pointer; }
.notif > i { font-size: 18px; color: var(--accd); }
.notif .nt { font-size: 13px; font-weight: 600; color: var(--accd); }
.notif .ns { font-size: 11px; color: var(--accd); opacity: .8; margin-top: 2px; }
.notif.muted { background: var(--graybg); cursor: pointer; }
.notif.muted > i, .notif.muted .nt { color: #5F5E5A; }
.notif.muted .ns { color: #7A7972; }
.notif.denied { background: #FCEBEB; cursor: default; }
.notif.denied > i, .notif.denied .nt, .notif.denied .ns { color: #A32D2D; }
.perm { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; flex: none; }
.perm.ok { background: var(--okbg); color: #0F6E56; }
.perm.no { background: #FCEBEB; color: #A32D2D; }
.perm.un { background: var(--graybg); color: #5F5E5A; }
.sect { font-size: 11.5px; font-weight: 600; color: var(--hint); letter-spacing: .3px; margin: 18px 0 9px 2px; text-transform: uppercase; }
.gr { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.gr:last-child { border-bottom: none; }
.gn { font-size: 13.5px; font-weight: 600; }
.gc { font-size: 11.5px; color: var(--mut); margin-top: 1px; }
.bg-grade { font-size: 13px; font-weight: 600; padding: 4px 11px; border-radius: 9px; min-width: 34px; text-align: center; }
.gA { background: var(--okbg); color: #0F6E56; }
.gB { background: #E6F1FB; color: #0C447C; }
.gP { background: var(--graybg); color: #6B6A64; }
.last { font-size: 11.5px; color: var(--hint); text-align: right; margin: 9px 2px 0 0; }
.last.warn { color: var(--warn); }
.set { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set:last-child { border-bottom: none; }
.setn { font-size: 13.5px; font-weight: 600; }
.sets { font-size: 11px; color: var(--mut); margin-top: 1px; }
.foot { display: flex; flex-direction: column; gap: 9px; margin-top: 24px; }
.empty { text-align: center; padding: 26px 10px; color: var(--mut); }
.empty .ei { width: 48px; height: 48px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 22px; color: var(--hint); }
.empty .et { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.empty .es { font-size: 12px; margin-top: 4px; line-height: 1.5; }
.sk { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #EEF0F3, #F6F7F9, #EEF0F3); background-size: 200% 100%; animation: sh 1.3s infinite; }
@keyframes sh { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* iOS 설치 안내 시트 */
.modal { position: fixed; inset: 0; background: rgba(20,24,33,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal[hidden] { display: none; }
.sheet { background: #fff; width: 100%; max-width: 440px; border-radius: 22px 22px 0 0; padding: 22px 22px 28px; text-align: center; }
.sheet .si { width: 54px; height: 54px; border-radius: 15px; background: var(--accl); color: var(--acc); display: flex; align-items: center; justify-content: center; font-size: 26px; margin: 0 auto 14px; }
.sheet h4 { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.sheet p { font-size: 13px; color: var(--mut); line-height: 1.6; margin: 0 0 16px; }
.istep { display: flex; align-items: center; gap: 11px; text-align: left; background: var(--bg); border-radius: 12px; padding: 11px 13px; margin-bottom: 9px; font-size: 13px; }
.iico { flex: none; width: 30px; height: 30px; border-radius: 8px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--acc); font-size: 16px; }
.istep b { font-weight: 600; color: var(--ink); }

.grow { flex: 1; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 10px; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90%; }
.toast.show { opacity: .95; }

/* 가로모드 차단: 휴대폰을 가로로 돌리면 안내만 표시 (PWA는 manifest orientation으로도 고정) */
@media (orientation: landscape) and (max-height: 500px) {
  .app, .modal, .toast { display: none !important; }
  body::after {
    content: "세로 모드로 이용해 주세요";
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    background: #fff; color: var(--mut); font-size: 15px; font-weight: 600;
  }
}
