:root {
  --bg: #f4f6fa; --card: #fff; --ink: #1b2330; --mute: #5d6878; --line: #dde3ec;
  --brand: #1f4e9c; --brand-ink: #fff;
  --safe: #1e7a46; --safe-bg: #e3f4ea;
  --fit: #1f5fbf; --fit-bg: #e4eefc;
  --bold: #a55a00; --bold-bg: #fdf0dc;
  --up: #b3261e; --up-bg: #fde5e3;
  --no: #6b7280; --no-bg: #eef0f3;
  --err: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161d; --card: #1b212b; --ink: #e7ebf1; --mute: #9aa5b5; --line: #2c3442;
    --brand: #3d6fc4;
    --safe: #6fd39b; --safe-bg: #17331f; --fit: #8cb6ff; --fit-bg: #172741;
    --bold: #f0b45e; --bold-bg: #3a2a12; --up: #ff9a92; --up-bg: #3d1a18;
    --no: #a3aab5; --no-bg: #262c36; --err: #ff9a92;
  }
}
:root[data-theme="dark"] {
  --bg: #12161d; --card: #1b212b; --ink: #e7ebf1; --mute: #9aa5b5; --line: #2c3442;
  --brand: #3d6fc4;
  --safe: #6fd39b; --safe-bg: #17331f; --fit: #8cb6ff; --fit-bg: #172741;
  --bold: #f0b45e; --bold-bg: #3a2a12; --up: #ff9a92; --up-bg: #3d1a18;
  --no: #a3aab5; --no-bg: #262c36; --err: #ff9a92;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--brand); color: var(--brand-ink); padding: 22px 0 18px; }
.top h1 { margin: 0; font-size: 1.45rem; }
.top .sub { margin: 4px 0 0; opacity: .9; font-size: .95rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 16px 0; }
.card h2 { margin: 0 0 12px; font-size: 1.1rem; }
.card h3 { margin: 18px 0 8px; font-size: 1rem; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--mute); }
.grid input { font: inherit; font-size: 1.15rem; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); width: 100%; }
.grid input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.hint { color: var(--mute); font-size: .85rem; margin: 10px 0 0; }
.err { color: var(--err); font-size: .9rem; margin: 8px 0 0; }
.mine { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--bg); font-size: .92rem; }
.mine b { font-size: 1.05rem; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select, .filters input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.filters input { flex: 1 1 160px; min-width: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 4px; }
.tabs button { font: inherit; font-size: .9rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.tabs button .c { opacity: .7; margin-left: 4px; }

.row { display: grid; grid-template-columns: 64px 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .nm { font-weight: 600; }
.row .meta { grid-column: 2; color: var(--mute); font-size: .82rem; }
.row .df { grid-column: 3; grid-row: 1 / span 2; text-align: right; font-variant-numeric: tabular-nums; }
.row .df b { display: block; font-size: 1.05rem; }
.row .df small { color: var(--mute); font-size: .78rem; }
.row .b { grid-row: 1 / span 2; }
.b { display: inline-block; text-align: center; padding: 3px 0; width: 56px; border-radius: 6px; font-size: .82rem; font-weight: 700; }
.b-safe { color: var(--safe); background: var(--safe-bg); }
.b-fit { color: var(--fit); background: var(--fit-bg); }
.b-bold { color: var(--bold); background: var(--bold-bg); }
.b-up { color: var(--up); background: var(--up-bg); }
.b-no { color: var(--no); background: var(--no-bg); }
.empty { color: var(--mute); padding: 18px 0; text-align: center; }

.note ul { margin: 0; padding-left: 20px; }
.note li { margin: 4px 0; font-size: .92rem; }
.rule { border-collapse: collapse; font-size: .9rem; }
.rule th { text-align: left; padding: 4px 10px 4px 0; }
.rule td { padding: 4px 0; }
#sources li { font-size: .85rem; color: var(--mute); }
.foot { color: var(--mute); font-size: .8rem; padding-bottom: 28px; }

/* 성적 입력 표 */
.sc { display: flex; flex-direction: column; gap: 8px; }
.sc-h, .sc-r { display: grid; grid-template-columns: 52px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 6px; align-items: center; }
.sc-h { font-size: .78rem; color: var(--mute); }
.sc-n { font-weight: 600; font-size: .88rem; white-space: nowrap; }
.sc select, .sc input { font: inherit; font-size: 1rem; padding: 9px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); width: 100%; min-width: 0; }
.sc select:focus, .sc input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.sc-g { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.sc-g label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--mute); }
@media (max-width: 420px) { .sc-h, .sc-r { grid-template-columns: 42px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 34px; } .sc select, .sc input { font-size: .95rem; padding: 8px 6px; } }
.mine .mu { margin-top: 6px; }
.mine .mu > span { display: inline-block; min-width: 48px; font-weight: 700; margin-right: 6px; }
.row .ft { font-weight: 400; color: var(--mute); font-size: .75rem; }
.warn { display: block; color: var(--bold); font-size: .78rem; margin-top: 2px; }
.sc-gr { text-align: center; font-weight: 700; font-size: .95rem; }
.sc input.auto { color: var(--fit); font-style: italic; }

/* 보기 전환 */
.views { display: flex; gap: 6px; margin-bottom: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; flex-wrap: wrap; }
.views button { flex: 1 1 0; white-space: nowrap; font: inherit; font-size: .86rem; font-weight: 600; padding: 8px 4px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.views button[aria-selected="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.views .c { opacity: .85; margin-left: 2px; }

/* 칸수 막대 */
.kanrow { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.kan { display: inline-flex; gap: 2px; vertical-align: middle; }
.kan i { width: 9px; height: 12px; border-radius: 2px; background: var(--line); }
.kan i.on { background: var(--no); }
.kan i.on.k9, .kan i.on.k8, .kan i.on.k7 { background: var(--safe); }
.kan i.on.k6, .kan i.on.k5 { background: var(--fit); }
.kan i.on.k4, .kan i.on.k3 { background: var(--bold); }
.kan i.on.k2 { background: var(--up); }
.kn { font-size: .8rem; font-weight: 700; margin-right: 4px; }

/* 담기 버튼 */
.pick { display: inline-flex; gap: 4px; align-items: center; margin-left: auto; }
.pick small { color: var(--mute); font-size: .72rem; }
.pick button { font: inherit; font-size: .78rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--brand); background: transparent; color: var(--brand); cursor: pointer; }
.pick button.on { background: var(--brand); color: #fff; }

/* 위치 그래프 */
.gsvg { width: 100%; height: auto; display: block; }
.gsvg .z-no { fill: var(--no-bg); } .gsvg .z-up { fill: var(--up-bg); } .gsvg .z-bold { fill: var(--bold-bg); }
.gsvg .z-fit { fill: var(--fit-bg); } .gsvg .z-safe { fill: var(--safe-bg); }
.gsvg .zt { font-size: 9px; text-anchor: middle; fill: var(--mute); }
.gsvg .ul { font-size: 10px; text-anchor: end; fill: var(--ink); font-weight: 600; }
.gsvg .lane { stroke: var(--line); stroke-width: 1; }
.gsvg .dot { stroke: var(--card); stroke-width: 1; cursor: pointer; }
.gsvg .d-safe { fill: var(--safe); } .gsvg .d-fit { fill: var(--fit); } .gsvg .d-bold { fill: var(--bold); }
.gsvg .d-up { fill: var(--up); } .gsvg .d-no { fill: var(--no); }
.gsvg .dot.picked { stroke: var(--ink); stroke-width: 2; }
.gsvg .me { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 3; }
.gsvg .mt { font-size: 10px; text-anchor: middle; font-weight: 700; fill: var(--ink); }
.gsvg .ax { font-size: 9px; fill: var(--mute); } .gsvg .ax.end { text-anchor: end; }
.ginfo { margin-top: 10px; padding: 10px; border-radius: 8px; background: var(--bg); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; }

/* 지원 조합 */
.slot { display: grid; grid-template-columns: 40px 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.slot > b { font-size: 1rem; grid-row: 1 / span 2; }
.slot .nm { font-weight: 600; }
.slot.empty span { color: var(--mute); font-size: .88rem; }
.slot .rm { grid-column: 3; grid-row: 1 / span 2; font: inherit; font-size: .8rem; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.slot .b { justify-self: start; }
.cmsg { margin: 12px 0 4px; padding: 10px 12px; border-radius: 8px; background: var(--fit-bg); color: var(--ink); font-size: .92rem; }

/* 모의지원 */
.slot .mk { grid-column: 2 / 4; font-size: .84rem; }
.slot .mk.mute { color: var(--mute); }
.slot .mk em { font-style: normal; font-weight: 700; margin-left: 4px; }
.slot .mk em.in { color: var(--safe); } .slot .mk em.out { color: var(--up); }
.mbar { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.mbar button { font: inherit; font-weight: 700; padding: 10px 14px; border-radius: 8px; border: 0; background: var(--brand); color: #fff; cursor: pointer; }
.mbar button.sub { background: var(--card); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.mbar button:disabled { opacity: .5; cursor: default; }

/* ===== 글꼴: 모든 글자 Noto Sans KR ===== */
button, input, select, textarea, svg text { font-family: "Noto Sans KR", system-ui, sans-serif; }

/* ===== 내 환산점수 카드 ===== */
.mine { background: transparent; padding: 0; margin-top: 16px; }
.mh { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.mh b { font-size: 1rem; }
.mh small { color: var(--mute); font-size: .78rem; }
.mgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mc { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.mc .mu { font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
.mc .ml { display: flex; justify-content: space-between; gap: 6px; font-size: .8rem; color: var(--mute); line-height: 1.7; }
.mc .ml b { color: var(--ink); font-size: .88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== 학과 카드 (이전 줄 배치를 덮어씀) ===== */
#list .row { display: block; padding: 14px 2px; border-bottom: 1px solid var(--line); }
#list .row:last-child { border-bottom: 0; }
.r1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.r1 .nm { font-weight: 700; font-size: 1.02rem; line-height: 1.35; }
.r1 .nm small { display: block; font-weight: 500; font-size: .76rem; color: var(--mute); margin-bottom: 1px; }
.r1 .b { flex: none; width: auto; padding: 3px 10px; }
.r2 { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.r2 .kan i { width: 14px; height: 10px; border-radius: 3px; }
.r2 .kn { font-size: .85rem; margin-left: 6px; }
.dv { font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.dv.d-safe { color: var(--safe); } .dv.d-fit { color: var(--fit); } .dv.d-bold { color: var(--bold); } .dv.d-up { color: var(--up); } .dv.d-no { color: var(--no); }
.cmp { display: flex; gap: 14px; margin-top: 4px; font-size: .8rem; color: var(--mute); }
.cmp b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tags span { font-size: .74rem; color: var(--mute); background: var(--bg); border-radius: 999px; padding: 2px 8px; }
.note2 { margin: 6px 0 0; font-size: .76rem; color: var(--mute); }
#list .warn, .row .warn { display: block; margin: 6px 0 0; font-size: .78rem; color: var(--bold); }
.act { display: flex; justify-content: flex-end; margin-top: 8px; }
.act .pick { margin-left: 0; }

.kanw { display: inline-flex; align-items: center; }
details > summary.mh { cursor: pointer; list-style: none; padding: 10px 12px; border-radius: 10px; background: var(--bg); margin-bottom: 0; }
details > summary.mh::-webkit-details-marker { display: none; }
details > summary.mh::after { content: "펼치기 ▾"; margin-left: auto; font-size: .78rem; color: var(--brand); font-weight: 500; }
details[open] > summary.mh { margin-bottom: 8px; }
details[open] > summary.mh::after { content: "접기 ▴"; }
details > summary.mh { white-space: nowrap; }
details > .note2 { margin: 0 0 8px; }

/* 지원 조합 칸 정리 */
.slot { grid-template-columns: 44px minmax(0, 1fr) auto; align-items: start; }
.slot > b { grid-row: auto; padding-top: 14px; }
.slot .sbody { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.slot .sbody .nm { font-weight: 700; line-height: 1.35; }
.slot .sbody .nm small { display: block; font-weight: 500; font-size: .76rem; color: var(--mute); }
.slot .sline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slot .sline .b { width: auto; padding: 3px 10px; }
.slot .mk { grid-column: auto; display: block; }
.slot .rm { grid-column: auto; grid-row: auto; align-self: center; }
.slot.empty { grid-template-columns: 44px 1fr; align-items: center; }
.slot.empty > b { padding-top: 0; }
.kanw .kn { margin-left: 6px; }

/* 꼭 읽어 주세요·자료 출처: 눌러서 펼치기 */
.note { padding: 4px 16px; }
.fold { border-bottom: 1px solid var(--line); }
.fold:last-child { border-bottom: 0; }
.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h2 { margin: 0; font-size: 1.05rem; }
.fold > summary::after { content: "펼치기 ▾"; font-size: .8rem; color: var(--brand); font-weight: 500; flex: none; }
.fold[open] > summary::after { content: "접기 ▴"; }
.fold[open] { padding-bottom: 14px; }

/* 3년 추이 */
.trend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 6px; font-size: .76rem; color: var(--mute); }
.trend .tl { width: 100%; font-size: .72rem; }
.trend b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.trend i { font-style: normal; color: var(--line); }
.trend .tn { width: 100%; display: flex; gap: 6px; flex-wrap: wrap; }
.trend em { font-style: normal; font-weight: 500; border-radius: 4px; padding: 0 6px; }
.trend em.dn { color: var(--fit); background: var(--fit-bg); }
.trend em.up { color: var(--up); background: var(--up-bg); }
.trend em.vol { color: var(--bold); background: var(--bold-bg); }

/* 칸으로 고르기 */
#kanpick { margin-top: 12px; }
.kpick-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.kpick-h b { font-size: .92rem; }
.kpick-h small { color: var(--mute); font-size: .74rem; text-align: right; }
.kclear { font: inherit; font-size: .78rem; border: 0; background: none; color: var(--brand); cursor: pointer; padding: 2px 4px; }
.kpick { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
.kpick button { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 5px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.kpick button b { font-size: .78rem; font-weight: 700; }
.kpick button span { font-size: .7rem; color: var(--mute); font-variant-numeric: tabular-nums; }
.kpick button:disabled { opacity: .35; cursor: default; }
.kpick button.k9, .kpick button.k8, .kpick button.k7 { border-top: 3px solid var(--safe); }
.kpick button.k6, .kpick button.k5 { border-top: 3px solid var(--fit); }
.kpick button.k4, .kpick button.k3 { border-top: 3px solid var(--bold); }
.kpick button.k2 { border-top: 3px solid var(--up); }
.kpick button.k1 { border-top: 3px solid var(--no); }
.kpick button.on { background: var(--ink); color: var(--card); border-color: var(--ink); }
.kpick button.on span { color: var(--card); opacity: .8; }
.kunis { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--bg); }
.kunis > span { width: 100%; font-size: .8rem; font-weight: 700; margin-bottom: 2px; }
.kunis button { font: inherit; font-size: .8rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.kunis button small { color: var(--mute); margin-left: 2px; }
.kunis button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.kunis button.on small { color: #fff; }
.tabs.dim { opacity: .45; }
