body { background: #e9ebf2; }
.phone {
  max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg);
  position: relative; padding-bottom: 76px;
  box-shadow: 0 0 40px rgba(20, 30, 60, .08);
}
.app-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; background: rgba(244, 245, 249, .92); backdrop-filter: blur(10px);
}
.app-bar h1 { flex: 1; font-size: 19px; font-weight: 800; }
.icon-btn { border: 0; background: transparent; font-size: 22px; width: 36px; height: 36px; border-radius: 10px; line-height: 1; }
.icon-btn:hover { background: rgba(0,0,0,.05); }
#backBtn { font-size: 30px; margin-left: -8px; }

#view { padding: 4px 16px 24px; }
#view > * + * { margin-top: 14px; }

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.tabbar a .ti { font-size: 20px; filter: grayscale(1); opacity: .6; }
.tabbar a.active { color: var(--primary); }
.tabbar a.active .ti { filter: none; opacity: 1; }
.tabbar .dot { position: absolute; top: 2px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

body.logged-out .tabbar, body.logged-out .app-bar { display: none; }
body.logged-out .phone { padding-bottom: 0; }

/* ---------- 로그인 ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 8px; }
.login .logo { font-size: 44px; }
.login h2 { font-size: 24px; font-weight: 800; margin: 10px 0 4px; }
.login form { margin-top: 28px; }
.login .hint { margin-top: 16px; text-align: center; }

/* ---------- 홈 ---------- */
.hello { background: linear-gradient(135deg, #4353e8, #6b5cf0); color: #fff; border: 0; }
.hello h2 { font-size: 20px; font-weight: 800; }
.hello p { opacity: .85; font-size: 14px; margin-top: 4px; }
.hello .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.hello .stats a { background: rgba(255,255,255,.15); border-radius: 12px; padding: 10px; text-align: center; }
.hello .stats b { display: block; font-size: 22px; }
.hello .stats span { font-size: 12px; opacity: .85; }

/* ---------- 리스트 ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; background: transparent; border-left: 0; border-right: 0; border-top: 0; }
.list-item:last-child { border-bottom: 0; }
a.list-item:active, button.list-item:active { background: var(--surface-2); }
.list-item .title { font-weight: 700; font-size: 15px; }
.list-item .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.list-item .chev { color: #b8bdc9; font-size: 20px; }
.section-label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 18px 4px 8px; }
.icon-box { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-weak); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

/* ---------- 상세 ---------- */
.detail-head h2 { font-size: 20px; font-weight: 800; }
.detail-body { font-size: 15px; line-height: 1.7; white-space: normal; }

.dropzone {
  display: block; border: 2px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center;
  background: var(--surface-2); cursor: pointer;
}
.dropzone:hover { border-color: var(--primary); }
.dropzone input { display: none; }
.dropzone .big { font-size: 30px; }
.picked { margin-top: 8px; }
.picked .file-chip { margin-top: 6px; }

/* ---------- 성적 ---------- */
.score-big { font-size: 44px; font-weight: 800; color: var(--primary); line-height: 1; }
.score-big small { font-size: 18px; color: var(--muted); font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-grid > div { background: var(--surface-2); border-radius: 12px; padding: 10px; text-align: center; }
.stat-grid b { display: block; font-size: 18px; }
.stat-grid span { font-size: 12px; color: var(--muted); }
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.score-pill { font-weight: 800; font-size: 18px; color: var(--primary); }
