/* 뉴플랜 학생 사이트 — 폰 세로 기준, 큰 글씨, 주 색 #0080FF(작업지시서 3번 7항), 강조 노랑은 아이콘의 칠한 칸 색 */
:root {
  --brand: #0080FF;
  --brand-600: #0066D6;
  --brand-700: #0052AD;
  --brand-50: #EAF4FF;
  --brand-100: #D4E8FF;
  --accent: #FFC400;
  --ink: #121A23;
  --sub: #5B6B7B;
  --faint: #8A99A8;
  --line: #E3E9F0;
  --bg: #F5F8FC;
  --card: #FFFFFF;
  --good: #12805C;
  --good-50: #E3F5EC;
  --warn: #A35F00;
  --warn-50: #FFF4DB;
  --bad: #D93025;
  --bad-50: #FDECEA;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 18px rgba(16, 24, 40, .06);
  --r: 18px;
  --bar-h: 66px;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #EAF0F6; --sub: #A3B3C2; --faint: #75879A; --line: #26323F; --bg: #0C131B; --card: #151F2A;
          --brand-50: #0E2A48; --brand-100: #123A63; --good: #4FD29A; --good-50: #0F2E21; --warn: #F2C063; --warn-50: #33270A;
          --bad: #FF8A7A; --bad-50: #3A1714; --shadow: 0 1px 2px rgba(0, 0, 0, .4); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }                 /* display를 정한 단추도 hidden이면 숨김 */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
  letter-spacing: -0.01em;
}
a { color: var(--brand); text-decoration: none; font-weight: 600; }
svg.i { width: 22px; height: 22px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 위 막대: 흰 바탕(홈은 파란 머리 카드가 따로) */
#bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; min-height: 56px;
  padding: calc(env(safe-area-inset-top) + 6px) 8px 6px; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
}
#bar.scrolled { border-bottom-color: var(--line); }
#bar h1 { flex: 1; margin: 0 8px; font-size: 19px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.icon { display: grid; place-items: center; background: transparent; color: var(--brand); border: 0; min-width: 44px; min-height: 44px; padding: 0; border-radius: 12px; }
button.icon:active { background: var(--brand-50); }
#busy { position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: 3px; background: linear-gradient(90deg, transparent, var(--brand), transparent);
        background-size: 50% 100%; background-repeat: no-repeat; animation: slide 1s ease-in-out infinite; }
@keyframes slide { from { background-position: -50% 0; } to { background-position: 150% 0; } }
main { padding: 8px 16px calc(var(--bar-h) + 40px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
body.notabs main { padding-bottom: 140px; }
#bar[hidden] + #busy + main, #bar[hidden] ~ main { padding-top: calc(env(safe-area-inset-top) + 16px); }
h2 { font-size: 24px; line-height: 1.3; margin: 4px 0 8px; font-weight: 800; letter-spacing: -0.02em; }
h3 { font-size: 18px; margin: 22px 4px 10px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; }
h4 { font-size: 16px; margin: 14px 0 4px; }
p { margin: 6px 0; }
.muted { color: var(--sub); }
.small { font-size: 14px; }
.center { text-align: center; }
.err { color: var(--bad); font-weight: 700; min-height: 1em; font-size: 15px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* 카드 */
.card { background: var(--card); border-radius: var(--r); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .card { border: 1px solid var(--line); } }

/* 로그인 첫 화면 */
.hero { text-align: center; padding: 28px 8px 8px; }
.hero img { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 10px 30px rgba(0, 128, 255, .35); }
.hero h2 { font-size: 30px; margin: 16px 0 4px; }
.hero p { color: var(--sub); margin: 0; }

/* 홈 머리 카드 */
.head-card { position: relative; overflow: hidden; color: #fff; border-radius: 24px; padding: 20px 18px 18px; margin: 4px 0 14px;
  background: radial-gradient(120% 140% at 100% 0%, #3AA4FF 0%, var(--brand) 45%, var(--brand-600) 100%); box-shadow: 0 12px 30px rgba(0, 102, 214, .28); }
.head-card::after { content: ""; position: absolute; right: -26px; bottom: -30px; width: 104px; height: 104px; border-radius: 50%;
  background: var(--accent); opacity: .85; box-shadow: 0 0 0 14px rgba(255, 255, 255, .25); }
.head-card .hi { font-size: 15px; opacity: .9; }
.head-card .who { font-size: 24px; font-weight: 800; margin: 2px 0 12px; }
.head-card .sum { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; }
.head-card .sum span { background: rgba(255, 255, 255, .18); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 700; }

/* D-day */
.dday { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.dday::-webkit-scrollbar { display: none; }
.dday-item { flex: 0 0 auto; min-width: 128px; background: var(--card); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.dday-item b { display: block; font-size: 24px; font-weight: 900; color: var(--brand); letter-spacing: -0.02em; }
.dday-item.soon b { color: var(--bad); }
.dday-item span { display: block; font-weight: 700; font-size: 15px; }
.dday-item small { color: var(--sub); font-size: 13px; }

/* 빠른 단추 */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 4px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; border: 0; border-radius: var(--r); padding: 16px;
  font: inherit; font-weight: 800; font-size: 17px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.tile .ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--brand-50); color: var(--brand); }
.tile.primary { background: var(--brand); color: #fff; }
.tile.primary .ic { background: rgba(255, 255, 255, .2); color: #fff; }
.tile small { font-weight: 500; font-size: 13px; color: var(--sub); margin-top: -6px; }
.tile.primary small { color: rgba(255, 255, 255, .85); }
.tile:active { transform: scale(.98); }

/* 알림 띠 */
.alert { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--ink); border: 0; border-radius: 16px;
  padding: 14px; margin: 10px 0; background: var(--warn-50); }
.alert .ic { color: var(--warn); }
.alert b { display: block; }

/* 목록 */
.list { list-style: none; margin: 0; padding: 0; }
.list > li > button, .item {
  width: 100%; text-align: left; background: var(--card); border: 0; border-radius: var(--r); box-shadow: var(--shadow);
  padding: 14px 14px 14px 16px; margin: 10px 0; font: inherit; color: inherit; display: flex; align-items: center; gap: 12px; min-height: 72px;
}
.list > li > button:active { background: var(--brand-50); }
.list.plain > li { padding: 10px 2px; border-bottom: 1px solid var(--line); }
.name { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 1.35; }
.meta { color: var(--sub); font-size: 14px; margin-top: 2px; }
.meta .due-soon { color: var(--bad); font-weight: 700; }
.chev { color: var(--faint); }
.badge { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--brand-50); color: var(--brand); font-weight: 900; font-size: 15px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--line); color: var(--sub); white-space: nowrap; }
.chip.ok { background: var(--good-50); color: var(--good); }
.chip.warn { background: var(--warn-50); color: var(--warn); }
.chip.bad { background: var(--bad-50); color: var(--bad); font-size: 16px; padding: 6px 12px; }
.chip.brand { background: var(--brand-50); color: var(--brand); }
.empty { text-align: center; color: var(--sub); padding: 28px 12px; }
.empty .ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--brand-50); color: var(--brand); margin-bottom: 8px; }

/* 입력 */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.field .label { font-weight: 800; font-size: 15px; padding: 0; }
.field .hint { color: var(--sub); font-size: 13px; }
input[type=text], input[type=password], textarea {
  width: 100%; font: inherit; font-size: 17px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: none; overflow: hidden; line-height: 1.45; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100); }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 2px; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); flex: 0 0 auto; }
.classes { display: grid; gap: 8px; }
.classes .check { background: var(--bg); border-radius: 12px; padding: 4px 12px; }

/* 단추 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 20px;
  border-radius: 15px; border: 0; background: var(--brand-50); color: var(--brand-700); font: inherit; font-weight: 800; font-size: 17px;
}
@media (prefers-color-scheme: dark) { .btn { color: #8CC6FF; } }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(0, 128, 255, .3); }
.btn.primary:active { background: var(--brand-600); }
.btn.ghost { background: transparent; color: var(--sub); }
.btn[disabled] { opacity: .45; box-shadow: none; }
.btn.block { width: 100%; margin: 8px 0; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btns { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.btns.two { display: grid; grid-template-columns: 1fr 1fr; }
.sticky-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg); background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.sticky-foot .inner { max-width: 640px; margin: 0 auto; }
body:not(.notabs) .sticky-foot { bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); padding-bottom: 12px; }   /* 아래 탭 위에
*/
body:not(.notabs) main { padding-bottom: calc(var(--bar-h) + 120px + env(safe-area-inset-bottom)); }
.sticky-foot .btn.block { margin: 0; }

/* 아래 탭 */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); min-height: calc(var(--bar-h) + env(safe-area-inset-bottom));
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--card); background: color-mix(in srgb, var(--card) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--line); }
#tabs[hidden] { display: none; }
#tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--faint); font-size: 12px; font-weight: 700; }
#tabs a.on { color: var(--brand); }
#tabs a .dot { position: relative; }
#tabs a .dot[data-n]::after { content: attr(data-n); position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }

/* 단계 표시 */
.steps { display: flex; gap: 6px; margin: 4px 0 12px; }
.steps span { flex: 1; text-align: center; font-size: 13px; font-weight: 800; color: var(--faint); padding: 8px 4px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.steps span.on { color: var(--brand); background: var(--brand-50); box-shadow: none; }
.tips { display: flex; gap: 10px; align-items: flex-start; }
.tips ul { margin: 2px 0 0; padding-left: 18px; color: var(--sub); font-size: 15px; }

/* 사진 제출 */
.shots { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.shot { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center; background: var(--card); border-radius: var(--r); padding: 10px; box-shadow: var(--shadow); }
.shot img { width: 76px; height: 100px; object-fit: cover; border-radius: 10px; background: #fff; }
.shot-text { font-size: 15px; font-weight: 700; display: flex; gap: 6px; align-items: flex-start; }
.shot-text.ok { color: var(--good); }
.shot-text.warn { color: var(--warn); }
.shot-text.muted { font-weight: 500; color: var(--sub); }
.live { background: #000; border-radius: var(--r); padding: 8px; margin: 10px 0; }
.live video { width: 100%; border-radius: 12px; display: block; }
.live-label { color: #fff; background: rgba(0, 0, 0, .6); font-weight: 800; padding: 12px; border-radius: 12px; margin: 8px 0; text-align: center; }
.live-label.ok { background: var(--good); }
.live-label.warn { background: #A35F00; }

/* 제출 끝 */
.done-mark { display: grid; place-items: center; width: 84px; height: 84px; margin: 12px auto 6px; border-radius: 50%; background: var(--good-50); color: var(--good); }
.done-mark svg.i { width: 44px; height: 44px; stroke-width: 2.6; }

/* 묻기 */
.ask-img { width: 100%; border-radius: 12px; background: #fff; margin: 10px 0; border: 1px solid var(--line); }
.choices { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0; justify-content: center; }
.choice { width: 72px; height: 72px; border-radius: 50%; font-size: 34px; border: 2.5px solid var(--brand); background: var(--card); color: var(--brand); }
.choice[aria-pressed=true] { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(0, 128, 255, .35); }

/* 웹 OMR */
.omr-top { position: sticky; top: calc(env(safe-area-inset-top) + 56px); z-index: 4; background: var(--bg); padding: 6px 0 8px; }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .2s; }
.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 8px 0 4px; scrollbar-width: none; }
.tab { flex: 0 0 auto; font: inherit; font-size: 15px; font-weight: 700; padding: 8px 16px; border-radius: 999px; border: 0; background: var(--card); color: var(--sub); box-shadow: var(--shadow); }
.tab[aria-pressed=true] { background: var(--brand); color: #fff; }
.qrow { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.qrow.short { align-items: flex-start; }
.qrow.filled .qno { color: var(--brand); }
.qno { width: 42px; flex: 0 0 auto; text-align: right; font-weight: 900; color: var(--faint); padding-top: 2px; font-variant-numeric: tabular-nums; }
.bubbles { display: flex; gap: 6px; flex: 1; min-width: 0; }
.bubble { flex: 1 1 0; min-width: 0; max-width: 46px; aspect-ratio: 1 / 1; height: auto; border-radius: 50%; font-size: 21px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); padding: 0; }   /* 작은 폰에서는 칸이 줄어듦 */
@media (max-width: 360px) { .qno { width: 34px; } .bubble { font-size: 18px; } .bubbles { gap: 4px; } }
.bubble[aria-pressed=true] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.sub { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.omr-card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px 12px; }

/* 결과 */
.score-ring { --p: 0; width: 148px; height: 148px; margin: 8px auto 4px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line) 0); }
.score-ring > div { width: 118px; height: 118px; border-radius: 50%; background: var(--card); display: grid; place-items: center; text-align: center; }
.score-ring b { display: block; font-size: 36px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.score-ring small { color: var(--sub); font-size: 13px; }
.wrong { display: flex; flex-wrap: wrap; gap: 8px; }
.score-text { font-weight: 800; font-size: 17px; margin: 8px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.prose ul { padding-left: 20px; margin: 4px 0; color: var(--sub); }

/* 내 정보 */
.avatar { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 22px; background: var(--brand); color: #fff; font-size: 28px; font-weight: 900; }

#toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--bar-h) + 24px + env(safe-area-inset-bottom)); z-index: 40; margin: 0 auto; max-width: 600px;
  background: #121A23; color: #fff; padding: 14px 16px; border-radius: 14px; font-size: 16px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  white-space: pre-line; animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #busy, #toast, .progress i { animation: none; transition: none; } }
