:root {
  --bg: #f4f5fb; --card: #ffffff; --text: #191c2b; --muted: #6e7389; --line: #e6e8f1;
  --accent: #5b5bf6; --accent-2: #a855f7; --accent-soft: #eeeeff; --danger: #e5484d; --fire: #ff7a1a;
  --g1: #16a36a; --g2: #66b84a; --g3: #e3ad22; --g4: #ee7f2d; --g5: #e5484d;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #c026d3 100%);
  --shadow: 0 1px 2px rgba(25,28,60,.05), 0 6px 20px rgba(25,28,60,.06);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1018; --card: #181b27; --text: #eceef7; --muted: #9196ad; --line: #272b3b;
    --accent: #8b8cff; --accent-2: #c084fc; --accent-soft: #23244a; --danger: #f2686c; --fire: #ff9447;
    --g1: #3dcb8a; --g2: #8ad06a; --g3: #f1c94e; --g4: #f59a55; --g5: #f2686c;
    --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #a21caf 100%);
    --shadow: none;
  }
}
:root[data-theme="dark"] {
    --bg: #0e1018; --card: #181b27; --text: #eceef7; --muted: #9196ad; --line: #272b3b;
    --accent: #8b8cff; --accent-2: #c084fc; --accent-soft: #23244a; --danger: #f2686c; --fire: #ff9447;
    --g1: #3dcb8a; --g2: #8ad06a; --g3: #f1c94e; --g4: #f59a55; --g5: #f2686c;
    --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #a21caf 100%);
    --shadow: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); letter-spacing: -0.01em;
  font-family: "Pretendard", "Pretendard Variable", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", -apple-system, sans-serif; line-height: 1.5; }
.top { max-width: 1040px; margin: 0 auto; padding: 20px 16px 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { display: inline-flex; width: 34px; height: 34px; }
.logo svg { width: 100%; height: 100%; }
h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.sub { margin: 0; color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 4px; margin-top: 16px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
main { max-width: 1040px; margin: 0 auto; padding: 16px; }
.tab { display: none; }
.tab.active { display: block; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card.muted { opacity: .75; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.card h3 { margin: 16px 0 8px; font-size: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 2px; }
.kpi .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.up { color: var(--g1); } .down { color: var(--g5); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; }
label small { font-weight: 400; }
label.inline { max-width: 320px; margin-bottom: 12px; }
input, select, textarea { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.row.wrap { flex-wrap: wrap; }
.btn { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; transition: transform .08s, box-shadow .15s, border-color .15s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(91,91,246,.28); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.filebtn { display: inline-block; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.badge { font-size: 11px; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.tablewrap { overflow-x: auto; }
.gp { display: inline-block; min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 999px; color: #fff; font-weight: 600; font-size: 12px; }
.gp.g1 { background: var(--g1); } .gp.g2 { background: var(--g2); } .gp.g3 { background: var(--g3); color: #222; }
.gp.g4 { background: var(--g4); } .gp.g5 { background: var(--g5); } .gp.g0 { background: var(--line); color: var(--muted); }
svg.chart { width: 100%; height: auto; display: block; }
svg text { fill: var(--muted); font-size: 11px; font-family: inherit; }
svg .axis { stroke: var(--line); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list li:last-child { border-bottom: 0; }
.insight { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 8px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
/* 위쪽 하위 탭: 알약형 */
.seg.segbar { border: 0; background: var(--line); padding: 4px; border-radius: 14px; gap: 2px; }
.seg.segbar button { border-radius: 10px; padding: 8px 10px; }
.seg.segbar button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.result { font-size: 15px; padding: 14px; border-radius: 10px; margin-top: 12px; background: var(--accent-soft); }
.result b { font-size: 20px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 16px 40px; }

/* ---------- 모바일 우선 보강 ---------- */
.bottombar, .backdrop { display: none; }
.sheethead { display: flex; justify-content: space-between; align-items: center; }
.sheethead .btn { display: none; }
.toolbar { display: none; }
.recs li { flex-direction: column; align-items: stretch; gap: 6px; }
.recs .line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.recs .meta { font-size: 12px; color: var(--muted); }
.recs .acts { display: flex; gap: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: #1c2430; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; opacity: 0;
  pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
svg text { font-size: 12px; }

@media (max-width: 760px) {
  body { -webkit-tap-highlight-color: transparent; }
  .top { padding: calc(10px + env(safe-area-inset-top)) 16px 0; }
  .tabs { display: none; }
  .logo { font-size: 26px; }
  h1 { font-size: 18px; }
  main { padding: 12px 12px calc(88px + env(safe-area-inset-bottom)); }
  footer { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .card { padding: 14px; border-radius: 14px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .v { font-size: 24px; }
  input, select, textarea { font-size: 16px; padding: 11px 12px; }   /* iOS 확대 방지 */
  .btn { padding: 11px 16px; min-height: 44px; }
  .btn.sm { padding: 6px 12px; min-height: 36px; }
  .grid { grid-template-columns: 1fr 1fr; }
  svg text { font-size: 17px; }

  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--card) 92%, transparent);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottombar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: 0;
    padding: 8px 0 6px; font: inherit; font-size: 11px; font-weight: 600; color: var(--muted); min-height: 58px; cursor: pointer; }
  .bottombar button.active { color: var(--accent); font-weight: 800; }
  .bottombar .ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .bottombar button.active .ic { stroke-width: 2.4; }
  .bottombar button[data-tab="study"] .ic { color: #fff; background: var(--grad); border-radius: 12px; width: 34px; height: 34px; padding: 5px; margin-top: -10px; box-shadow: 0 4px 12px rgba(99,102,241,.4); }

  /* 입력 폼 → 하단 시트 */
  .toolbar { display: block; position: sticky; top: 0; z-index: 5; padding: 0 0 10px; background: var(--bg); }
  .toolbar .btn { width: 100%; }
  .backdrop { display: block; position: fixed; inset: 0; background: rgba(10,15,25,.45); z-index: 44; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .backdrop.open { opacity: 1; pointer-events: auto; }
  .formcard { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 50; max-height: 90vh; overflow-y: auto;
    border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform .25s ease; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .formcard.open { transform: none; }
  .sheethead .btn { display: inline-block; }
  .formcard .row .btn.primary { flex: 1; }
}

/* ---------- 입시/목표 기능 ---------- */
.segbar { display: flex; width: 100%; }
.segbar button { flex: 1; }
.pf { display: inline-block; font-size: 11px; line-height: 1.5; padding: 1px 7px; margin: 1px 2px 1px 0; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pf.y { background: var(--g1); border-color: var(--g1); color: #fff; }
.pfcell { white-space: normal; min-width: 150px; }
.ok { color: var(--g1); } .warn { color: var(--g4); }
.crow { flex-direction: column; align-items: stretch !important; gap: 8px; }
.crow .line { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.crow .meta { font-size: 12px; color: var(--muted); }
.crow .ctrls { justify-content: flex-start; align-items: flex-end; gap: 10px; }
label.mini { font-size: 11px; gap: 2px; width: auto; }
label.mini input, label.mini select { padding: 6px 8px; font-size: 14px; width: 84px; }
label.mini.chk { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text); padding-bottom: 6px; }
label.mini.chk input { width: auto; }
input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--accent); }
details.card summary { cursor: pointer; font-weight: 600; font-size: 15px; }
textarea { resize: vertical; }
@media (max-width: 760px) {
  .bottombar button { font-size: 10.5px; }
  label.mini input, label.mini select { font-size: 16px; }
}

/* 개발(Vercel 미리보기) 표시 */
.devbadge { position: fixed; top: calc(6px + env(safe-area-inset-top)); right: 8px; z-index: 70; background: #d64545; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; opacity: .92; pointer-events: none; }

/* ---------- 시험 결과 빠른 입력 ---------- */
body.noscroll { overflow: hidden; }
.toolbar .btn + .btn { margin-top: 8px; }
.qsheet { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; transform: translateY(102%); transition: transform .25s ease; max-width: 640px; margin: 0 auto; }
.qsheet.open { transform: none; }
.qhead { display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); background: var(--card); }
.qhead h2 { margin: 0; font-size: 17px; }
.qbody { flex: 1; overflow-y: auto; padding: 14px 16px 24px; }
.qfoot { display: flex; gap: 10px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.qfoot .btn.primary { flex: 1; }
.qfoot .btn:disabled { opacity: .45; }
.qlist { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.qrow { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.qrow .line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qrow .meta { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.qres { font-size: 13px; text-align: right; }
.qgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.qgrid.two { grid-template-columns: 1fr 1fr; }
.qgrid label { font-size: 11px; gap: 2px; }
.qgrid input, .qgrid select { padding: 9px 6px; text-align: center; font-size: 16px; }
@media (min-width: 761px) { .qsheet { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }
.qbody > .hint:first-child { margin-bottom: 14px; }

/* ---------- 홈: 지금 할 일 · 첫 실행 안내 ---------- */
.todos { display: flex; flex-direction: column; gap: 8px; }
.todo { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 60px; cursor: pointer; }
.todo:hover, .todo:active { border-color: var(--accent); }
.todo .ico { font-size: 24px; width: 32px; text-align: center; }
.todo .tx { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.todo .tx b { font-size: 15px; }
.todo .tx small { color: var(--muted); font-size: 12px; }
.todo .chev { color: var(--muted); font-size: 22px; }
.onb { background: var(--accent-soft); border-color: transparent; }
.onb ol { margin: 0 0 4px; padding-left: 20px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- 도움말(?) ---------- */
.hi { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; vertical-align: middle; margin-left: 4px; user-select: none; -webkit-user-select: none; font-style: normal; }
.hi:hover, .hi:focus-visible { background: var(--accent); color: #fff; outline: none; }
.hback { position: fixed; inset: 0; background: rgba(10,15,25,.45); z-index: 89; opacity: 0; pointer-events: none; transition: opacity .2s; }
.hback.open { opacity: 1; pointer-events: auto; }
.hsheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; max-width: 640px; margin: 0 auto; background: var(--card); border-radius: 18px 18px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .22s ease; box-shadow: 0 -4px 24px rgba(0,0,0,.18); }
.hsheet.open { transform: none; }
.hsheet h3 { margin: 0 0 8px; font-size: 17px; }
.hsheet p { margin: 0 0 16px; font-size: 15px; line-height: 1.65; }
.hsheet .btn { width: 100%; }

/* ---------- 수강 계획: 한 줄 행 ---------- */
.recs2 { margin: 0; padding: 0; list-style: none; }
.crow2 { border-bottom: 1px solid var(--line); }
.crow2:last-child { border-bottom: 0; }
.crow2.cand { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; margin-left: -4px; }
.crow-top { display: flex; align-items: center; gap: 8px; }
.crow-main { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; background: none; border: 0; font: inherit; color: inherit; text-align: left; padding: 10px 0; cursor: pointer; min-height: 52px; }
.crow-main .cn { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.crow-main .cn b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow-main .cn small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.alt { border-color: var(--accent); color: var(--accent); }
.crow-main .chev { color: var(--muted); font-size: 14px; width: 14px; text-align: center; }
.pickbox { display: flex; align-items: center; padding: 6px 4px; cursor: pointer; }
.pickbox input { width: 22px; height: 22px; accent-color: var(--accent); }
.cdetail { display: none; padding: 2px 0 12px; }
.crow2.open .cdetail { display: grid; grid-template-columns: 1fr 1fr 1.2fr auto; gap: 8px; align-items: end; }
.cdetail label.mini input, .cdetail label.mini select { width: 100%; }
details.adv { margin-top: 10px; }
details.adv summary { cursor: pointer; font-size: 13px; color: var(--accent); }
@media (max-width: 760px) { .crow2.open .cdetail { grid-template-columns: 1fr 1fr; } .cdetail .btn { grid-column: 1 / -1; } }

.qgrid { align-items: end; }

/* ---------- 목표 대학 · 합격 가능성 ---------- */
.probrow { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin: 12px 0 6px; }
.plabel { font-size: 12px; color: var(--muted); }
.pval { font-size: 28px; font-weight: 800; line-height: 1.2; }
.tiers { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tiers small { color: var(--muted); font-size: 11px; }
.chip.tier { font-weight: 700; padding: 3px 12px; font-size: 13px; }
.chip.tier.안정 { background: var(--g1); border-color: var(--g1); color: #fff; }
.chip.tier.적정 { background: var(--g3); border-color: var(--g3); color: #222; }
.chip.tier.도전 { background: var(--g4); border-color: var(--g4); color: #fff; }
.gauge .track { position: relative; height: 12px; border-radius: 999px; background: var(--line); }
.gauge .range { position: absolute; top: 0; bottom: 0; border-radius: 999px; opacity: .85; }
.gauge .range.안정 { background: var(--g1); } .gauge .range.적정 { background: var(--g3); } .gauge .range.도전 { background: var(--g4); }
.gauge .mark { position: absolute; top: -3px; width: 4px; height: 18px; margin-left: -2px; background: var(--text); border-radius: 2px; }
.gauge .scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 3px; }
.glist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gitem { display: flex; gap: 10px; }
.gitem .ico { font-size: 20px; width: 28px; text-align: center; }
.gitem .tx { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.gitem .tx b { font-size: 14px; }
.gitem .tx small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.gitem .tx .btn { align-self: flex-start; margin-top: 4px; }
.tgt h3 { margin: 14px 0 4px; }

/* ---------- NEIS 점자 가져오기 ---------- */
.brfprev { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.brfprev h3 { margin: 0 0 8px; }
.brfprev table input.mini-in { min-width: 92px; padding: 6px 8px; font-size: 14px; }
.brfprev table select { padding: 6px 8px; font-size: 13px; width: auto; }
.brfprev table input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.brfprev .btn:disabled { opacity: .45; }

.brfrows { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.brfrow { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--bg); }
.brfrow.bad { opacity: .75; }
.brfrow .top { display: flex; gap: 8px; align-items: center; }
.brfrow .top .mini-in { flex: 1; min-width: 0; padding: 8px 10px; font-size: 15px; }
.brfrow .top select { width: 84px; padding: 8px 6px; font-size: 14px; }
.brfrow .top input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.brfrow .info { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 8px; padding-left: 30px; }
.brfrow .info .res { margin-left: auto; color: var(--text); font-size: 13px; }

.steps { margin: 10px 0; padding-left: 20px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.brfpre { max-height: 260px; overflow: auto; font-size: 11px; line-height: 1.4; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; white-space: pre-wrap; word-break: break-all; }

.brfh { margin: 14px 0 0; font-size: 14px; }
.brfh small { color: var(--muted); font-weight: 400; }
#brfText { font-size: 15px; line-height: 1.5; margin-top: 6px; }

.wiperow { display: flex; justify-content: flex-end; padding: 0 0 8px; }

/* 수시 후보 찾기 */
.exf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.exf .plabel { min-width: 64px; }
.exf .chip { cursor: pointer; background: var(--card); font: inherit; font-size: 12px; }
.exrow { border-top: 1px solid var(--line); padding: 10px 0; }
.exrow:first-child { border-top: 0; }
.extop { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.exmeta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.exnote { font-size: 12px; margin-top: 4px; }
.dim { color: var(--muted); }
.chip.tier.어려움 { background: var(--line); border-color: var(--line); color: var(--muted); }

/* 분석 탭 > 내 위치 */
.segbar { overflow-x: auto; }
.segbar button { flex: 1 0 auto; white-space: nowrap; padding-left: 10px; padding-right: 10px; }
.hero { background: linear-gradient(135deg, var(--accent-soft), var(--card)); border-color: var(--accent); }
.hero-t { font-size: 12px; color: var(--muted); }
.hero-b { font-size: 22px; font-weight: 800; margin: 4px 0; }
.hero-s { font-size: 14px; line-height: 1.6; }
.pcard .pwho { margin: 10px 0 6px; font-size: 15px; }
.pbar { position: relative; display: flex; height: 22px; border-radius: 999px; overflow: visible; margin: 6px 0 12px; }
.pbar .z { display: flex; align-items: center; justify-content: center; font-size: 11px; font-style: normal; font-weight: 700; color: #fff; }
.pbar .z:first-child { border-radius: 999px 0 0 999px; } .pbar .z:nth-child(5) { border-radius: 0 999px 999px 0; }
.pbar .z1 { background: var(--g1); } .pbar .z2 { background: var(--g2); } .pbar .z3 { background: var(--g3); color: #222; } .pbar .z4 { background: var(--g4); } .pbar .z5 { background: var(--g5); }
.pbar .me { position: absolute; top: -5px; width: 4px; height: 32px; margin-left: -2px; background: var(--text); border-radius: 3px; box-shadow: 0 0 0 2px var(--card); }
.plist { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.plist li { padding: 5px 0; border-top: 1px dashed var(--line); } .plist li:first-child { border-top: 0; }
.dist { display: flex; gap: 2px; margin-top: 10px; font-size: 10px; }
.dist i { font-style: normal; text-align: center; padding: 3px 0; border-radius: 4px; background: var(--line); color: var(--muted); min-width: 22px; }
.dist i.me { background: var(--accent); color: #fff; font-weight: 700; }

/* 공부 모드 */
.btn.big { font-size: 17px; padding: 14px 22px; border-radius: 12px; }
.st-clock { font-size: 46px; font-weight: 800; text-align: center; letter-spacing: 1px; font-variant-numeric: tabular-nums; margin-top: 4px; }
.st-sub { text-align: center; font-size: 13px; color: var(--muted); }
.st-today { font-size: 15px; text-align: center; margin: 8px 0 4px; }
.tcard .st-today { text-align: left; margin: 2px 0; }
.tbar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 4px 0; }
.tbar i { display: block; height: 100%; background: var(--g1); border-radius: 999px; transition: width .4s; }
.cheer { margin: 10px 0 0; font-size: 14px; text-align: center; color: var(--text); }
.tcard .cheer { text-align: left; font-size: 13px; }
.ck { list-style: none; margin: 0; padding: 0; }
.ck li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); }
.ck li:first-child { border-top: 0; } .ck li.done span { text-decoration: line-through; color: var(--muted); }
.ck label, .chk, .ckg label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.chk { margin-top: 8px; font-size: 14px; }
.ckl { list-style: none; margin: 0; padding: 0; } .ckg { padding: 8px 0; border-top: 1px dashed var(--line); } .ckg:first-child { border-top: 0; }
.ckg span small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; font-weight: 400; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 10px; }
.cw { text-align: center; font-size: 11px; color: var(--muted); }
.cd { position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 0; font: inherit; overflow: hidden; cursor: pointer; }
.cd.empty { border: 0; background: none; cursor: default; }
.cd .fill { position: absolute; inset: 0; background: var(--g1); }
.cd .n { position: absolute; top: 3px; left: 5px; font-size: 11px; color: var(--text); z-index: 1; }
.cd .m { position: absolute; bottom: 3px; right: 4px; font-size: 10px; font-weight: 700; z-index: 1; color: var(--text); }
.cd.tod { border-color: var(--accent); } .cd.goal { border-color: var(--g1); border-width: 2px; } .cd.sel { box-shadow: 0 0 0 2px var(--accent); }
.wbars { display: flex; gap: 8px; align-items: flex-end; height: 150px; margin-top: 6px; }
.wb { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.wbar { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--line); border-radius: 6px; overflow: hidden; }
.wbar i { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; } .wbar i.ok { background: var(--g1); }
.wv { font-size: 10px; color: var(--muted); height: 14px; } .wd { font-size: 11px; margin-top: 3px; }
/* 집중 화면(공부 중) */
.focus { position: fixed; inset: 0; z-index: 100; background: #0f1520; color: #fff; display: flex; align-items: center; justify-content: center; padding: 24px; }
.focus[hidden] { display: none; }
.fm-in { width: 100%; max-width: 420px; text-align: center; }
.fm-top { font-size: 15px; color: #9fb0c8; } .fm-clock { font-size: 64px; margin: 14px 0 22px; color: #fff; }
.fm-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; } .fm-btns .btn { background: #1c2736; border-color: #2c3a50; color: #fff; }
.fm-btns .btn.primary { background: var(--accent); border-color: var(--accent); } .fm-btns .btn.danger { color: #ff8d8d; }
.fm-today { margin-top: 26px; font-size: 16px; color: #cdd8e8; } .fm-today .dim { color: #7f90a8; }
.fm-close { margin-top: 28px; background: none; border: 0; color: #7f90a8; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
body.focusing { overflow: hidden; }

/* 데이터 탭 안의 위쪽 탭 */
.subtabs { margin-bottom: 12px; }

/* 우리 반 인원 입력칸: 낮은 높이, 입력 대기 중에는 밝은 노랑 */
.classin { width: 76px; height: 30px; padding: 2px 8px; font-size: 14px; text-align: center; border-radius: 8px; }
.classin.wait, .classin:focus { background: #fff7a8; border-color: #e0c200; color: #222; outline: none; box-shadow: 0 0 0 2px rgba(224, 194, 0, .35); }

/* 목표 등급 드롭다운: 글자가 화살표에 가려지지 않게 폭을 넉넉히 */
select[data-on="setTarget"] { min-width: 94px; width: 94px; padding: 8px 22px 8px 10px; font-size: 14px; text-overflow: clip; }
.tgtbl th, .tgtbl td { padding-left: 4px; padding-right: 4px; font-size: 14px; }
.tgtbl th { white-space: normal; line-height: 1.25; }
.tgtbl td:last-child { white-space: nowrap; }
label.mini select { width: 104px; }

/* =====================================================================
   v2 디자인: 홈 · 순공 · 동기부여
   ===================================================================== */
.ch { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.ch h2 { margin: 0; }
.dim { color: var(--muted); }
.grid.one { grid-template-columns: 1fr !important; }

/* 인사 */
.greet { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 2px 2px 12px; }
.g-date { font-size: 13px; color: var(--muted); font-weight: 600; }
.g-hi { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.3; word-break: keep-all; }
.dday { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 76px; padding: 6px 10px; border-radius: 14px; border: 0; cursor: pointer; font: inherit; background: #191c2b; color: #fff; flex: none; }
.dday small { font-size: 10px; opacity: .75; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dday b { font-size: 18px; font-weight: 900; letter-spacing: -0.02em; color: #ffd166; }
.dday.add { background: var(--card); color: var(--muted); border: 1px dashed var(--line); }
.dday.add b { color: var(--accent); font-size: 14px; }

/* 응원 히어로 */
.hero2 { position: relative; overflow: hidden; background: var(--grad); color: #fff; border-radius: 22px; padding: 20px 18px 14px; margin-bottom: 14px; box-shadow: 0 10px 30px rgba(99,102,241,.3); }
.hero2::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero2::before { content: ""; position: absolute; right: 30px; bottom: -60px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.08); }
.h-k { font-size: 12px; font-weight: 700; opacity: .85; letter-spacing: .02em; position: relative; z-index: 1; }
.h-q { font-size: 19px; font-weight: 800; line-height: 1.45; margin: 6px 0 10px; letter-spacing: -0.02em; word-break: keep-all; position: relative; z-index: 1; }
.h-me { font-size: 13.5px; opacity: .95; position: relative; z-index: 1; word-break: keep-all; }
.h-motto { margin-top: 10px; display: inline-block; background: rgba(255,255,255,.18); padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; position: relative; z-index: 1; }
.h-acts { display: flex; gap: 6px; justify-content: flex-end; margin-top: 12px; position: relative; z-index: 1; }
.hbtn { background: rgba(255,255,255,.18); border: 0; color: #fff; font: inherit; font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px; cursor: pointer; }
.hbtn:active { background: rgba(255,255,255,.3); }

/* 링 */
.ring { position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring circle { fill: none; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

/* 홈: 순공 위젯 */
.studyw .sw-top { display: flex; gap: 16px; align-items: center; }
.mr-v { font-size: 17px; font-weight: 900; letter-spacing: -0.03em; }
.mr-l { font-size: 11px; color: var(--muted); }
.sw-week { flex: 1; min-width: 0; }
.sw-l { font-size: 12px; color: var(--muted); font-weight: 700; }
.sw-v { font-size: 26px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.2; }
.sw-d { font-size: 12px; font-weight: 700; color: var(--muted); }
.sw-d.up { color: var(--g1); } .sw-d.down { color: var(--g4); }
.mbars { display: flex; gap: 5px; margin-top: 8px; height: 58px; }
.mb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mbt { flex: 1; width: 100%; max-width: 18px; background: var(--line); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.mbt i { display: block; width: 100%; background: var(--accent); border-radius: 6px; opacity: .55; }
.mbt i.ok { background: var(--g1); opacity: 1; }
.mb span { font-size: 10px; color: var(--muted); }
.mb.today span { color: var(--accent); font-weight: 800; }
.mb.today .mbt i { opacity: 1; }
.mb.future .mbt { opacity: .45; }
.btn.wide { width: 100%; margin-top: 14px; }
.btn.big { font-size: 17px; padding: 14px 22px; border-radius: 16px; font-weight: 800; }
.btn.live { background: #191c2b; border-color: #191c2b; box-shadow: none; }
.btn.live b { font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-right: 6px; vertical-align: middle; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.sw-foot { display: flex; justify-content: space-between; margin-top: 10px; }
.lnk { background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 13px; font-weight: 700; color: var(--accent); cursor: pointer; }

/* 홈: 등급·목표 2칸 */
.hgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.hgrid .card { margin: 0; }
.card.mini { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 16px 14px; min-height: 150px; width: 100%; }
.mc-l { font-size: 12px; color: var(--muted); font-weight: 700; }
.mc-v { display: flex; align-items: baseline; gap: 4px; }
.mc-v small { color: var(--muted); font-size: 13px; font-weight: 700; }
.gnum { font-size: 34px; font-weight: 900; letter-spacing: -0.04em; line-height: 1.1; }
.gnum.g1 { color: var(--g1); } .gnum.g2 { color: var(--g2); } .gnum.g3 { color: var(--g3); } .gnum.g4 { color: var(--g4); } .gnum.g5 { color: var(--g5); }
.mc-s { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mc-tip { font-size: 12px; background: var(--accent-soft); border-radius: 10px; padding: 6px 8px; margin-top: auto; line-height: 1.4; word-break: keep-all; }
.mc-u { font-size: 21px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.2; word-break: keep-all; }
.mc-dp { font-size: 12.5px; color: var(--muted); font-weight: 600; word-break: keep-all; }
.mc-e { font-size: 14px; font-weight: 700; margin: 6px 0; line-height: 1.4; }
.gbar { width: 100%; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: auto; }
.gbar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.goalc { background: linear-gradient(160deg, var(--accent-soft), var(--card) 70%); }
.empty-mini .btn { margin-top: auto; }

/* 홈: 성장 줄 */
.card.growth { display: flex; align-items: center; gap: 14px; width: 100%; font: inherit; color: var(--text); text-align: left; cursor: pointer; padding: 14px 16px; }
.gr-l { display: flex; flex-direction: column; align-items: center; }
.gr-l small { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.flame { font-size: 22px; line-height: 1; display: flex; align-items: center; gap: 2px; filter: grayscale(.8); }
.flame b { font-size: 20px; font-weight: 900; color: var(--text); }
.flame.hot { filter: none; animation: flick 1.6s infinite; }
.flame.hot b { color: var(--fire); }
@keyframes flick { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.gr-m { flex: 1; min-width: 0; }
.gr-m small { font-size: 11.5px; color: var(--muted); }
.gr-lv { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.lvb { display: inline-block; background: var(--grad); color: #fff; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; margin-right: 4px; }
.xpbar { height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 3px 0; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #fbbf24, #f97316); border-radius: 999px; }
.gr-r { display: flex; align-items: center; gap: 2px; }
.gr-r .bdg i { margin-left: -8px; box-shadow: 0 0 0 2px var(--card); }
.gr-r .chev { color: var(--muted); font-size: 20px; margin-left: 4px; }
.bdg { display: inline-flex; align-items: center; gap: 6px; }
.bdg i { font-style: normal; display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-soft); font-size: 15px; }
.bdg.big { background: var(--card); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 13px; }
.bdg.big i { background: var(--accent-soft); margin: 0; box-shadow: none; }

/* 온보딩 */
.onb-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.onb-s { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font: inherit; color: var(--text); cursor: pointer; }
.onb-s span { font-size: 24px; }
.onb-s b { font-size: 13px; }
.onb-s small { font-size: 11px; color: var(--muted); line-height: 1.3; }

/* MY */
.profile { display: flex; align-items: center; gap: 14px; }
.pf-av { width: 52px; height: 52px; border-radius: 50%; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900; flex: none; }
.pf-tx { display: flex; flex-direction: column; min-width: 0; }
.pf-tx b { font-size: 17px; }
.pf-tx small { color: var(--muted); font-size: 12.5px; }
.menu { padding: 6px 4px; }
.mi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; border-radius: 12px; }
.mi:active { background: var(--bg); }
.mi > span:first-child { font-size: 22px; width: 30px; text-align: center; }
.mi .t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mi .t b { font-size: 15px; }
.mi .t small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi .chev { color: var(--muted); font-size: 20px; }

/* 순공: 타이머 카드 */
.timer-card { text-align: center; padding-top: 22px; }
.timer-card.running { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.tc-ring { display: flex; justify-content: center; }
.rt-lbl { font-size: 13px; color: var(--muted); font-weight: 700; }
.rt-clock { font-size: 40px; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.rt-sub { font-size: 12px; color: var(--muted); }
.tc-state { margin-top: 12px; font-weight: 800; font-size: 15px; }
.timer-card.paused .tc-state { color: var(--g4); }
.tc-meta { font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.mchip { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--line); color: var(--muted); display: inline-flex; align-items: center; }
.mchip.ok { background: color-mix(in srgb, var(--g1) 16%, transparent); color: var(--g1); }
.mchip.warn { background: color-mix(in srgb, var(--g4) 16%, transparent); color: var(--g4); }
.cheer { margin: 12px 0 0; font-size: 14px; text-align: center; color: var(--text); word-break: keep-all; }

/* 과목별 타이머 */
.subjs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.subj { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font: inherit; color: var(--text); cursor: pointer; text-align: left; min-height: 52px; }
.subj i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.subj .sn { flex: 1; font-weight: 700; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subj .sv { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.subj .sp { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 11px; color: var(--c); flex: none; }
.subj.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--card)); }
.subj.on .sp { background: var(--c); color: #fff; }
.chip .x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 4px; font-size: 11px; }

/* 기록 화면 */
.pillseg { display: flex; width: 100%; margin-bottom: 12px; }
.pillseg button { flex: 1; padding: 9px; }
.bigstat { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.bigstat .l { color: var(--muted); font-size: 13px; font-weight: 700; }
.bigstat .v { font-size: 26px; font-weight: 900; letter-spacing: -0.03em; }
svg .bar { fill: var(--accent); opacity: .5; }
svg .bar.ok { fill: var(--g1); opacity: .9; }
svg .bar.today { opacity: 1; }
svg .goalline { stroke: var(--g1); stroke-dasharray: 5 5; stroke-width: 1.5; }
svg .goaltx { fill: var(--g1); font-weight: 700; }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.statgrid.three { margin: 14px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.stat .l { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.stat b { font-size: 16px; font-weight: 900; letter-spacing: -0.02em; }
.donutwrap { display: flex; align-items: center; gap: 16px; }
.donut { width: 140px; height: 140px; flex: none; }
svg text.dn-l { font-size: 11px; }
svg text.dn-v { font-size: 17px; font-weight: 900; fill: var(--text); }
.dlegend { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-width: 0; }
.dlegend li { display: flex; align-items: center; gap: 6px; }
.dlegend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dlegend span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlegend small { color: var(--muted); width: 34px; text-align: right; }
.hours { display: flex; gap: 2px; height: 70px; align-items: flex-end; }
.hr { flex: 1; height: 100%; background: var(--line); border-radius: 3px; display: flex; align-items: flex-end; overflow: hidden; }
.hr i { display: block; width: 100%; background: var(--accent-2); }
.hrs-l { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 3px; }
.sdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* 집중 화면 v2 */
.focus { background: radial-gradient(circle at 50% 30%, #1d2050 0%, #0b0d1a 70%); transition: background .4s; }
.focus.moved { background: radial-gradient(circle at 50% 30%, #4a2412 0%, #140b07 70%); }
.focus.pause { background: radial-gradient(circle at 50% 30%, #262a38 0%, #0d0f16 70%); }
.focus .ring-bg { stroke: rgba(255,255,255,.1); }
.focus .ring { margin: 18px auto 10px; }
.fm-top { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; font-size: 15px; color: #c7cbe6; font-weight: 700; }
.fm-subj { background: var(--c); color: #fff; padding: 3px 12px; border-radius: 999px; font-size: 13px; }
.fm-clock { font-size: 50px; margin: 0; color: #fff; }
.fm-today { margin-top: 4px; font-size: 13px; color: #aeb4d6; }
.fm-today .dim { color: #7c82a6; }
.fm-tip { color: #a5b4fc; font-size: 14px; font-weight: 700; margin: 4px 0 16px; }
.fm-tip.warn { color: #fdba74; }
.fm-quote { color: #8e93b8; font-size: 13px; margin-top: 22px; word-break: keep-all; }

/* 미니 타이머(다른 탭에서) */
.minitimer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 45; display: flex; align-items: center; gap: 6px;
  background: #191c2b; color: #fff; border: 0; border-radius: 999px; padding: 10px 18px; font: inherit; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer; white-space: nowrap; }
.minitimer b { font-variant-numeric: tabular-nums; }
.minitimer .mt-s { font-size: 11px; opacity: .7; }
.minitimer.paused .dot { background: #f59e0b; animation: none; }
.minitimer[hidden] { display: none; }
@media (min-width: 761px) { .minitimer { bottom: 24px; } }

/* 시트 공통 · 세션 결과 · 배지 */
.hsheet { max-height: 88vh; overflow-y: auto; border-radius: 24px 24px 0 0; }
.hsheet .row .btn { width: auto; }
.sumsheet { text-align: center; }
.sum-h { font-size: 18px; font-weight: 900; }
.sum-v { font-size: 44px; font-weight: 900; letter-spacing: -0.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.2; margin-top: 6px; }
.sum-s { color: var(--muted); font-size: 13px; }
.hsheet p.sum-q { color: var(--muted); font-size: 13px; word-break: keep-all; }
.lvline { text-align: left; margin: 8px 0; }
.lvline span { font-weight: 800; font-size: 14px; }
.lvline small { color: var(--muted); font-size: 12px; }
.newbdg { background: var(--accent-soft); border-radius: 14px; padding: 10px; margin: 10px 0; }
.bdgrow { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.bdggrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bg { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: var(--bg); opacity: .5; }
.bg.on { opacity: 1; background: var(--accent-soft); }
.bg i { font-style: normal; font-size: 26px; }
.bg b { font-size: 12px; }
.bg small { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 120; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: fall 2.2s ease-in forwards; }
@keyframes fall { to { top: 105%; transform: translateX(40px) rotate(540deg); } }

@media (max-width: 380px) {
  .hgrid { gap: 8px; } .card.mini { padding: 14px 12px; }
  .gnum { font-size: 30px; } .mc-u { font-size: 18px; }
  .statgrid { grid-template-columns: 1fr 1fr; }
  .rt-clock { font-size: 34px; }
}
@media (max-width: 760px) { body[data-tab="dash"] .top { display: none; } body[data-tab="dash"] main { padding-top: calc(16px + env(safe-area-inset-top)); } }
.sw-d.down { color: var(--muted); }
.statgrid.three { grid-template-columns: repeat(3, 1fr) !important; }

/* 뒤집기 안내(집중 화면) */
.flipguide { margin: 6px 0 14px; }
.flipph { width: 46px; height: 80px; margin: 0 auto 10px; border: 3px solid #fdba74; border-radius: 10px; position: relative; animation: flipme 2.4s ease-in-out infinite; }
.flipph i { position: absolute; left: 50%; top: 5px; width: 12px; height: 3px; margin-left: -6px; border-radius: 2px; background: #fdba74; }
@keyframes flipme { 0%, 30% { transform: perspective(300px) rotateX(0); } 60%, 100% { transform: perspective(300px) rotateX(180deg); opacity: .5; } }

/* 오늘은 내신왕: 왕관 */
.crownbar { margin-top: 12px; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; background: linear-gradient(90deg, #fff4d6, #ffe7a3); color: #7a4b00; word-break: keep-all; }
.crownbar b { color: #5c3800; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .crownbar { background: linear-gradient(90deg, #3d2f0f, #4a3610); color: #ffd98a; } :root:not([data-theme="light"]) .crownbar b { color: #ffe7a3; } }
:root[data-theme="dark"] .crownbar { background: linear-gradient(90deg, #3d2f0f, #4a3610); color: #ffd98a; } :root[data-theme="dark"] .crownbar b { color: #ffe7a3; }
.cd .cr { position: absolute; top: 1px; right: 2px; font-size: 10px; z-index: 1; }

/* 내신왕 계급 */
.card.tierw { display: flex; align-items: center; gap: 14px; width: 100%; font: inherit; color: var(--text); text-align: left; cursor: pointer; padding: 14px 16px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--tc, #94a3b8) 16%, var(--card)), var(--card) 75%); border-color: color-mix(in srgb, var(--tc, #94a3b8) 35%, var(--line)); }
.tierw.t0 { --tc: #84cc16; } .tierw.t1 { --tc: #a16207; } .tierw.t2 { --tc: #64748b; } .tierw.t3 { --tc: #0ea5e9; } .tierw.t4 { --tc: #8b5cf6; } .tierw.t5 { --tc: #f59e0b; } .tierw.t6 { --tc: #ec4899; }
.tw-i { font-size: 34px; width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--card); box-shadow: 0 2px 8px rgba(0,0,0,.08); flex: none; }
.tw-m { flex: 1; min-width: 0; }
.tw-l { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.tw-n { font-size: 18px; font-weight: 900; letter-spacing: -0.02em; }
.tw-n small { font-size: 12px; color: var(--muted); font-weight: 700; margin-left: 4px; }
.tw-m > small { font-size: 11.5px; color: var(--muted); }
.tierw .chev { color: var(--muted); font-size: 20px; }
.xpbar.gold i { background: linear-gradient(90deg, #fde68a, #f59e0b); }
.ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ladder li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--bg); opacity: .6; }
.ladder li.done { opacity: .85; }
.ladder li.me { opacity: 1; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.ladder .li-i { font-size: 20px; width: 26px; text-align: center; }
.ladder b { flex: 1; font-size: 14px; }
.ladder small { color: var(--muted); font-size: 12px; }
.tiercard { border-radius: 22px; padding: 22px 16px; color: #fff; background: var(--grad); margin-bottom: 10px; }
.tiercard.t5, .tiercard.t6 { background: linear-gradient(135deg, #f59e0b, #ec4899); }
.tc-m { font-size: 13px; opacity: .85; font-weight: 700; }
.tc-i { font-size: 64px; line-height: 1.2; margin-top: 6px; }
.tc-n { font-size: 30px; font-weight: 900; letter-spacing: -0.03em; }
.tc-s { font-size: 13px; opacity: .9; margin-top: 4px; }
.card.profile { width: 100%; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.profile .chev { margin-left: auto; color: var(--muted); font-size: 20px; }
.pf-tier { font-size: 12px; font-weight: 800; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 999px; margin-left: 4px; vertical-align: middle; }

/* 어두운 테마: 주 버튼은 진한 보라(흰 글자 대비 확보) */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { background: #5b5bf6; border-color: #5b5bf6; } }
:root[data-theme="dark"] .btn.primary { background: #5b5bf6; border-color: #5b5bf6; }
:root[data-theme="dark"] body, :root[data-theme="dark"] { color-scheme: dark; }

/* 토스트가 미니 타이머와 겹치지 않게 */
body:has(.minitimer:not([hidden])) .toast { bottom: calc(136px + env(safe-area-inset-bottom)); }

/* MY 탭 구획 · 설정 줄 · 스위치 */
.sect { margin: 18px 4px 8px; font-size: 13px; color: var(--muted); font-weight: 800; letter-spacing: .02em; }
.backbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.backbar h2 { margin: 0; font-size: 17px; }
.setc { padding: 4px 16px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); flex-direction: row; font-size: 14px; color: var(--text); cursor: pointer; }
.srow:last-child { border-bottom: 0; }
.srow .t { display: flex; flex-direction: column; min-width: 0; }
.srow .t b { font-size: 14.5px; font-weight: 700; }
.srow .t small { font-size: 12px; color: var(--muted); }
.srow select { width: auto; min-width: 110px; padding: 8px 10px; font-size: 14px; }
.lnkrow { width: 100%; background: none; border: 0; border-bottom: 0; font: inherit; text-align: left; }
.lnkrow .chev { color: var(--muted); font-size: 20px; }
input.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; flex: none; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; padding: 0; border: 0; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(20px); }
input.switch:focus { outline: none; }
details.brfwrap > summary { font-weight: 800; font-size: 15px; cursor: pointer; list-style: none; }
details.brfwrap > summary::-webkit-details-marker { display: none; }
details.brfwrap:not([open]) { display: none; }
details.brfwrap[open] > summary { margin-bottom: 8px; }

/* 첫 실행 설정 */
.setup { position: fixed; inset: 0; z-index: 130; background: var(--bg); overflow-y: auto; }
.su-in { max-width: 460px; margin: 0 auto; min-height: 100%; padding: calc(20px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; position: relative; }
.su-dots { display: flex; gap: 6px; justify-content: center; margin: 8px 0 22px; }
.su-dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--line); transition: width .2s; }
.su-dots i.on { width: 22px; background: var(--accent); }
.su-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.su-body h2 { margin: 6px 0 0; font-size: 24px; font-weight: 900; letter-spacing: -0.03em; }
.su-body input { font-size: 17px; padding: 14px; border-radius: 14px; }
.su-body .btn.wide { margin-top: 10px; }
.su-hero { text-align: center; margin: 8px 0 10px; }
.su-hero h1 { font-size: 30px; font-weight: 900; margin: 12px 0 2px; letter-spacing: -0.03em; }
.su-logo img { width: 92px; height: 92px; border-radius: 26px; box-shadow: 0 12px 30px rgba(99,102,241,.35); }
.su-tag { color: var(--muted); font-size: 15px; font-weight: 600; margin: 4px 0 0; }
.su-crown { font-size: 72px; animation: flick 1.6s infinite; }
.su-feat { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.su-feat li { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.su-feat span { font-size: 26px; }
.su-feat div { display: flex; flex-direction: column; }
.su-feat small { color: var(--muted); font-size: 12.5px; }
.su-l { margin: 12px 0 0; font-size: 13px; font-weight: 800; color: var(--muted); }
.su-l small { font-weight: 600; }
.su-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.su-chip { font-size: 14px; padding: 9px 16px; cursor: pointer; background: var(--card); font-weight: 700; }
.su-chip.alt { background: var(--accent); border-color: var(--accent); color: #fff; }
.su-skip, .su-back { position: absolute; top: calc(18px + env(safe-area-inset-top)); color: var(--muted); }
.su-skip { right: 18px; } .su-back { left: 18px; }
.su-skip2 { align-self: center; margin-top: 6px; color: var(--muted); }

/* =====================================================================
   성적 탭(분석) v2: 하위 탭 · 표 · 수치 상자 · 안내 상자 · 차트 · 순위 목록
   ===================================================================== */
.seg.segbar { position: relative; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.seg.segbar::-webkit-scrollbar { display: none; }
.seg.segbar button:last-child { margin-right: 18px; }

/* 표: 가벼운 머리줄, 숫자 정렬, 가로 스크롤 시 스크롤바 숨김 */
.tablewrap { scrollbar-width: thin; border-radius: 12px; }
table { font-variant-numeric: tabular-nums; }
th { background: var(--bg); color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 8px; border-bottom: 0; }
th:first-child { border-radius: 10px 0 0 10px; } th:last-child { border-radius: 0 10px 10px 0; }
td { padding: 10px 8px; }
tbody tr:last-child td { border-bottom: 0; }
@media (max-width: 760px) { table { font-size: 13px; } td, th { padding-left: 6px; padding-right: 6px; } }

/* 수치 상자(kpi) → 새 stat 모양 */
.kpis { gap: 10px; }
.kpi { border-radius: 16px; box-shadow: none; padding: 14px 12px; }
.kpi .l { font-weight: 700; font-size: 11.5px; }
.kpi .v { font-weight: 900; letter-spacing: -0.03em; }

/* 안내·결과 상자 */
.insight { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.55; border: 0; }
.result { border-radius: 14px; font-size: 14.5px; line-height: 1.6; }
.result b { font-size: 17px; }
.empty { border-radius: var(--radius); }

/* '내 위치' 머리 카드 */
.card.hero { background: linear-gradient(150deg, var(--accent-soft), var(--card) 65%); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.hero-t { font-weight: 700; }
.hero-b { font-weight: 900; letter-spacing: -0.03em; }

/* 차트 */
svg .grid { stroke: var(--line); stroke-dasharray: 4 6; }
svg text.xl { fill: var(--text); font-weight: 700; }
svg text.xl2 { fill: var(--muted); font-weight: 600; font-size: .85em; }
svg text.vl { font-weight: 800; }
.legend { justify-content: center; font-weight: 700; }

/* 요약 머리 카드 */
.ghero { background: linear-gradient(150deg, var(--accent-soft), var(--card) 60%); }
.gh-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.gh-l { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.gh-v { display: flex; align-items: baseline; gap: 4px; }
.gh-v .gnum { font-size: 44px; }
.gh-v small { color: var(--muted); font-weight: 700; }
.gh-w { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.gh-d { text-align: right; display: flex; flex-direction: column; padding: 8px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.gh-d b { font-size: 18px; font-weight: 900; }
.gh-d small { font-size: 11px; color: var(--muted); }
.gh-d.up b { color: var(--g1); } .gh-d.down b { color: var(--g4); }
.ghero .statgrid { margin: 14px 0 0; }
.stat small { font-size: 11px; }
.nextstep { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 0; background: #191c2b; color: #fff; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.nextstep .chev { margin-left: auto; opacity: .7; font-size: 18px; }
.keyl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.keyl li { display: flex; gap: 10px; font-size: 14px; line-height: 1.55; word-break: keep-all; }
.keyl li > span:first-child { font-size: 18px; line-height: 1.3; }

/* 순위 목록(올릴 과목·강점·어디부터 올릴까) */
.rankl { list-style: none; margin: 0; padding: 0; }
.rankl li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rankl li:last-child { border-bottom: 0; }
.rankl .rk { width: 24px; height: 24px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.rankl li:first-child .rk { background: var(--accent); color: #fff; }
.rankl .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rankl .nm b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rankl .nm small { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.rankl .nm small .gp { font-size: 10.5px; min-width: 18px; padding: 0 5px; }
.rankl .rt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.rankl .rt b { font-size: 15px; font-weight: 900; }
.rankl .rt small { font-size: 11.5px; color: var(--muted); }
.rankl .rt small.up { color: var(--g1); }
.gp { border-radius: 8px; font-weight: 800; }
.nextstep .ns { display: flex; flex-direction: column; min-width: 0; }
.nextstep .ns small { font-size: 11px; opacity: .7; font-weight: 700; }
svg text.vl { font-size: 19px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nextstep, :root:not([data-theme="light"]) .btn.live, :root:not([data-theme="light"]) .minitimer { background: #2a2d63; } }
:root[data-theme="dark"] .nextstep, :root[data-theme="dark"] .btn.live, :root[data-theme="dark"] .minitimer { background: #2a2d63; }

/* 성적 탭 맨 위 바로가기 */
.gquick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.gquick button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.gquick button span { font-size: 20px; line-height: 1.1; }
.gquick button:first-child { background: var(--accent); border-color: var(--accent); color: #fff; }
.gquick button:active { transform: scale(.97); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gquick button:first-child { background: #5b5bf6; border-color: #5b5bf6; } }
:root[data-theme="dark"] .gquick button:first-child { background: #5b5bf6; border-color: #5b5bf6; }
