:root {
  --bg: #f9f9f7; --surface: #fcfcfb; --card: #ffffff;
  --ink: #0b0b0b; --ink2: #52514e; --muted: #898781; --line: #e1e0d9; --axis: #c3c2b7;
  --brand: #1c5cab; --brand-soft: #e8f0fb;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;   /* 학업 · 진로 · 공동체 */
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --crit: #d03b3b;
  --r: 12px;
  --top: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Pretendard', 'Malgun Gothic', sans-serif; background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
h1 { font-size: 22px; margin: 4px 0 16px; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 0 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 15px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* 틀: 폰 = 위 헤더 + 아래 탭, PC = 왼쪽 메뉴 */
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; }
.who { font-size: 13px; color: var(--ink2); }
main { padding: 16px 16px 96px; max-width: 1200px; margin: 0 auto; }
.side { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.side a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; font-size: 11px; color: var(--muted); }
.side a .ic { font-size: 19px; line-height: 1; }
.side a.on { color: var(--brand); font-weight: 700; }
@media (min-width: 1024px) {
  #app { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: var(--top) 1fr; min-height: 100vh; }
  .top { grid-column: 1 / 3; }
  .side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); flex-direction: column; justify-content: flex-start;
    border-top: 0; border-right: 1px solid var(--line); padding: 12px 8px; }
  .side a { flex: none; flex-direction: row; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 15px; color: var(--ink2); }
  .side a.on { background: var(--brand-soft); color: var(--brand); }
  main { padding: 24px 32px 48px; width: 100%; }
}

/* 카드·버튼·입력 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.card.flat { box-shadow: none; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grid2 { display: grid; gap: 12px; }
@media (min-width: 1024px) { .grid2 { grid-template-columns: 1fr 1fr; } .split { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; } .split > .pane { position: sticky; top: calc(var(--top) + 16px); } }
.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 9px 14px; border-radius: 10px; font-weight: 600; }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; padding: 12px; }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 4px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--axis); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
textarea { min-height: 120px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: #fff; }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--axis); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--ink2); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.seg { display: inline-flex; border: 1px solid var(--axis); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 14px; color: var(--ink2); }
.seg button.on { background: var(--brand); color: #fff; font-weight: 700; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 12px; color: var(--ink2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-color: var(--brand); font-weight: 700; }

/* 뱃지 — 합격권은 상태색 + 글자 (색만으로 구분하지 않음) */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink2); white-space: nowrap; }
.badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.badge.b-안정::before { background: var(--good); }
.badge.b-적정::before { background: var(--s1); }
.badge.b-소신::before { background: var(--warn); }
.badge.b-도전::before { background: var(--crit); }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 6px; background: #f0efec; color: var(--ink2); margin-right: 4px; }
.tag.warn { background: #fff3d6; color: #7a5200; }
.tag.new { background: #e3f4ea; color: #006300; }
.tag.chg { background: #fde8de; color: #8a3410; }
.note { font-size: 13px; color: var(--ink2); background: #f4f3ef; border-radius: 10px; padding: 10px 12px; }
.warnbox { font-size: 13px; background: #fff7e6; border: 1px solid #f3d28a; color: #6b4a00; border-radius: 10px; padding: 10px 12px; }

/* 표 */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f6f8fc; }
.scroll { overflow-x: auto; }

/* 결과 목록 (폰은 카드, PC는 표) */
.res-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.res-item:last-child { border-bottom: 0; }
.res-item .t { font-weight: 700; }
.res-item .s { font-size: 13px; color: var(--ink2); }

/* 막대(비율·역량) */
.stack { display: flex; height: 26px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface); }
.stack > div { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; min-width: 0; white-space: nowrap; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--ink2); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: 56px 1fr 40px; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.hbar .track { height: 12px; background: #f0efec; border-radius: 0 4px 4px 0; }
.hbar .fill { height: 12px; border-radius: 0 4px 4px 0; background: var(--brand); }

.hero { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.hero .big { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.hero .lab { font-size: 12px; color: var(--muted); }

.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.tip { position: absolute; pointer-events: none; background: #0b0b0b; color: #fff; font-size: 12px; padding: 6px 8px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -110%); }

.auth { max-width: 420px; margin: 24px auto; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #0b0b0b; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; }
#toast.show { opacity: 1; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.hide-m { display: none; }
@media (min-width: 1024px) { .hide-m { display: initial; } .hide-pc { display: none; } }
@media print { .side, .top, .noprint { display: none !important; } main { padding: 0; } .card { break-inside: avoid; } }
