/* ============================================================
   수학아 놀자 (math.chatgpts.kr) - 공통 스타일
   - 모바일 우선 / 카드형 UI / 둥근 버튼 / 부드러운 그림자
   - 학교급 색상 구분: 초등=초록 / 중등=파랑 / 고등=보라
   ============================================================ */

:root {
  --ink:        #2b2f36;
  --ink-soft:   #555b66;
  --muted:      #8a919d;
  --line:       #e3e6ec;
  --bg:         #f7f8fc;
  --card:       #ffffff;
  --key:        #4263eb;
  --key-soft:   #edf1fd;
  --accent:     #2f9e44;
  --accent-soft:#e7f5ea;
  --warm:       #e67700;
  --warm-soft:  #fdf0dd;
  --lv-el:      #2f9e44;
  --lv-el-soft: #e7f5ea;
  --lv-mi:      #1971c2;
  --lv-mi-soft: #e3f0fb;
  --lv-hi:      #7048e8;
  --lv-hi-soft: #efeafd;
  --radius:     16px;
  --radius-lg:  22px;
  --shadow:     0 8px 24px rgba(43, 47, 54, .10);
  --shadow-sm:  0 1px 3px rgba(43, 47, 54, .06), 0 6px 18px rgba(43, 47, 54, .05);

  /* 공통 로그인 모듈(cg-auth.css)이 참조하는 토큰 */
  --cg-fg: var(--ink);
  --cg-muted: var(--muted);
  --cg-border: var(--line);
  --cg-accent: var(--key);
  --cg-btn-bg: #fff;
  --cg-btn-fg: var(--ink);
  --cg-btn-bg-hover: var(--key-soft);
  --cg-card-bg: var(--card);
  --cg-chip-bg: var(--key-soft);
  --cg-bg: var(--bg);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 10% 0%, #e8effd 0%, transparent 42%),
    radial-gradient(circle at 92% 8%, #e7f5ea 0%, transparent 40%),
    radial-gradient(circle at 50% 100%, #efeafd 0%, transparent 46%);
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
               'Noto Sans KR', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- 헤더 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 4px;
  margin: 0 -4px;
  background: rgba(247, 248, 252, .92);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.brand-logo .logo-char {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbe4fd, #b9cdfb);
  box-shadow: var(--shadow-sm);
  font-size: 21px;
}
.brand-logo .dot { color: var(--key); }
.header-right { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 다른 놀자 서비스 ---------- */
#family-nav { position: relative; }
#family-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
#family-btn:hover { background: var(--key-soft); }
#family-nav .family-dropdown {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 190px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
}
#family-nav.open .family-dropdown { display: block; }
#family-nav .family-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13px; font-weight: 600;
  text-decoration: none;
}
#family-nav .family-dropdown a:hover { background: var(--key-soft); }

/* ---------- 상단 메뉴 ---------- */
.nav-scroll {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 12px 0 14px;
  scrollbar-width: none;
}
.nav-scroll::-webkit-scrollbar { display: none; }
.nav-chip {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s ease, background .15s ease;
}
.nav-chip:hover { background: var(--key-soft); border-color: var(--key); }
.nav-chip.active { background: var(--key); border-color: var(--key); color: #fff; box-shadow: var(--shadow-sm); }

/* ---------- HERO ---------- */
.hero {
  margin: 14px 0 30px;
  padding: 52px 28px 44px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 2px solid #fff;
  box-shadow: var(--shadow);
  background:
    radial-gradient(120% 160% at 15% 0%, var(--key-soft) 0%, transparent 46%),
    radial-gradient(120% 160% at 90% 100%, var(--accent-soft) 0%, transparent 46%),
    #fff;
}
/* 대시보드형 좌우 히어로 (index 홈 전용) */
.hero--split {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 26px;
  align-items: center;
  text-align: left;
  padding: 40px 30px;
}
.hero--split .hero-left h1 { text-align: left; }
.hero--split .hero-left > p { margin: 0 0 20px; }
.hero--split .hero-actions { justify-content: flex-start; }
.hero-actions--sub { margin-top: 10px; }
.pill-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 14px; font-weight: 700;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.pill-link:hover { border-color: var(--key); transform: translateY(-1px); }

/* 오늘의 수학 미션 카드 */
.mission-card {
  background: linear-gradient(180deg, #fff 0%, var(--key-soft) 130%);
  border: 2px solid #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 22px;
  text-align: center;
}
.mission-badge {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  font-size: 13px; font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.mission-stats { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.ms-item {
  flex: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 10px 6px;
}
.ms-item strong { display: block; font-size: 18px; color: var(--key); }
.ms-item span { font-size: 12px; color: var(--muted); font-weight: 700; }
.mission-formula {
  display: flex; flex-direction: column; gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  margin-bottom: 14px;
  text-decoration: none;
  color: var(--ink);
  text-align: left;
  transition: transform .15s ease, border-color .15s ease;
}
.mission-formula:hover { transform: translateY(-2px); border-color: var(--key); }
.mission-formula strong { font-size: 16px; }
.mission-formula-eq {
  font-size: 14px; font-weight: 700; color: var(--key);
  background: var(--key-soft); border-radius: 8px; padding: 8px 10px;
}
.mission-cta { width: 100%; }
.hero-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--key);
  font-size: 14px; font-weight: 800;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.32;
}
.hero h1 .dot { color: var(--key); }
.hero p { margin: 0 auto 24px; max-width: 600px; color: var(--ink-soft); font-size: 16px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- 섹션 ---------- */
.section { padding: 30px 0 34px; }
.section:nth-of-type(even) {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 30px 22px 34px;
  margin-bottom: 8px;
}
.sec-head { text-align: center; margin: 4px 0 26px; }
.sec-head .eyebrow {
  display: inline-block;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: .08em;
  font-size: 12px;
  margin-bottom: 6px;
}
.sec-head h2 { margin: 0 0 8px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.sec-head p { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------- 학교급 진입 카드 ---------- */
.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0; }
.level-card {
  padding: 26px 18px 22px;
  border-radius: var(--radius-lg);
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.level-card:hover { transform: translateY(-4px); }
.level-card .emoji {
  font-size: 34px;
  width: 60px; height: 60px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 18px;
  background: rgba(255,255,255,.75);
  box-shadow: var(--shadow-sm);
}
.level-card h3 { margin: 12px 0 4px; font-size: 20px; font-weight: 800; }
.level-card p { margin: 0 0 12px; font-size: 13px; opacity: .85; line-height: 1.6; }
.level-card--el { background: var(--lv-el-soft); border-color: var(--lv-el); }
.level-card--mi { background: var(--lv-mi-soft); border-color: var(--lv-mi); }
.level-card--hi { background: var(--lv-hi-soft); border-color: var(--lv-hi); }
/* 홈 레벨 카드 풍성형 */
#home-levels .level-card { text-align: left; display: flex; flex-direction: column; }
#home-levels .level-card .emoji { align-self: center; }
#home-levels .level-card h3, #home-levels .level-card > p { text-align: center; }
.lc-units { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 10px; }
.lc-units span {
  font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
}
.lc-formulas { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.lc-formulas a {
  font-size: 13px; font-weight: 700; color: var(--ink);
  background: rgba(255,255,255,.8);
  border-radius: 8px; padding: 7px 10px; text-decoration: none;
}
.lc-formulas a:hover { color: var(--key); }
.lc-count { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; margin-bottom: 10px; }
.lc-foot { display: flex; gap: 8px; margin-top: auto; }
.lc-foot .btn { flex: 1; }

/* 오늘의 5문제 목록 */
.five-list { margin: 0; padding-left: 22px; }
.five-list li { margin-bottom: 8px; font-size: 15px; }
.five-list small { color: var(--muted); }

/* 암기팁 행 */
.tip-row { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.tip-row:last-child { border-bottom: none; }
.tip-row-head { font-weight: 800; font-size: 15px; }
.tip-row-tip { color: var(--warm); font-weight: 700; font-size: 14px; margin: 2px 0; }
.tip-row-easy { font-size: 13px; color: var(--muted); }

/* 헷갈리지 마 박스 */
.dont-box {
  font-size: 13px; font-weight: 700; color: #c0392b;
  background: #fff1f0; border: 1px dashed #e0655a;
  border-radius: 8px; padding: 8px 10px;
}

/* 인기 단원 칩 */
.unit-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.unit-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 14px; font-weight: 700;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.unit-chip:hover { transform: translateY(-2px); border-color: var(--key); }

/* focus 접근성 */
.btn:focus-visible, .pill-link:focus-visible, .unit-chip:focus-visible,
.nav-chip:focus-visible, .formula-card h3 a:focus-visible { outline: 3px solid var(--warm); outline-offset: 2px; }

/* ---------- 카드 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 14px; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}
.menu-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 104px;
  padding: 16px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  transition: transform .12s ease, border-color .12s ease;
}
.menu-grid a:hover { transform: translateY(-2px); border-color: var(--key); }
.menu-grid .emoji { font-size: 26px; line-height: 1; }
.menu-grid .label { font-weight: 700; font-size: 15px; }
.menu-grid .sub { font-size: 12px; color: var(--muted); }

/* ---------- 타이틀 ---------- */
.page-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .12em;
  color: var(--key); text-transform: uppercase;
}
h1.page-title { margin: 4px 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-desc { margin: 0 0 18px; color: var(--ink-soft); font-size: 15px; }
h2.sec-title { margin: 26px 0 10px; font-size: 18px; font-weight: 800; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 800;
  text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--key); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); background: var(--key); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.06); background: var(--accent); }
.btn-outline { background: #fff; border: 2px solid var(--key); color: var(--key); box-shadow: var(--shadow-sm); }
.btn-sm { padding: 9px 16px; font-size: 14px; font-weight: 700; }

/* ---------- 상태/빈 화면 ---------- */
.empty, .loading {
  padding: 28px 10px; text-align: center;
  color: var(--muted); font-size: 14px;
}

/* ---------- 공식 카드 ---------- */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.formula-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card);
  border: 2px solid var(--line);
  border-left: 5px solid var(--key);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.formula-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(43,47,54,.14); }
.formula-card.lv-el { border-left-color: var(--lv-el); }
.formula-card.lv-mi { border-left-color: var(--lv-mi); }
.formula-card.lv-hi { border-left-color: var(--lv-hi); }
.formula-card h3 {
  margin: 0; font-size: 17px; font-weight: 800; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.8em;
}
.formula-card h3 a { color: var(--ink); text-decoration: none; }
.formula-card h3 a:hover { color: var(--key); }
.formula-card .fc-tags { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.formula-card .fc-formula {
  font-size: 15px; font-weight: 700; color: var(--key);
  background: var(--key-soft); border-radius: 8px; padding: 8px 10px;
}
.formula-card .fc-easy { font-size: 13px; color: var(--ink-soft); }
.formula-card .fc-tip {
  font-size: 13px; font-weight: 700; color: var(--warm);
  background: var(--warm-soft); border-radius: 8px; padding: 8px 10px;
}
.formula-card .fc-foot { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.formula-card .fc-foot .btn { flex: 1; }
.badge-lv { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-lv.lv-el { background: var(--lv-el-soft); color: var(--lv-el); }
.badge-lv.lv-mi { background: var(--lv-mi-soft); color: var(--lv-mi); }
.badge-lv.lv-hi { background: var(--lv-hi-soft); color: var(--lv-hi); }
.badge-topic { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--ink-soft); }

/* ---------- 상세 설명 박스 ---------- */
.formula-big {
  font-size: 20px; font-weight: 800; text-align: center;
  background: var(--key-soft); border-radius: var(--radius);
  padding: 18px; margin: 14px 0;
}
.explain-sec { margin-bottom: 18px; }
.explain-sec h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; }
.explain-sec .body { font-size: 15px; }
.tip-box {
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  background: var(--warm-soft); border: 1px dashed var(--warm);
}
.tip-box h3 { margin: 0 0 6px; font-size: 15px; color: var(--warm); }
.warn-box {
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  background: #fff1f0; border: 1px dashed #e0655a;
}
.warn-box h3 { margin: 0 0 6px; font-size: 15px; color: #c0392b; }
.warn-box ul { margin: 0; padding-left: 18px; }
.check-box {
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  background: var(--accent-soft); border: 1px solid var(--accent);
}
.check-box h3 { margin: 0 0 6px; font-size: 15px; color: var(--accent); }
.step-list { margin: 0; padding-left: 20px; }
.step-list li { margin-bottom: 6px; }
.done-stamp {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 14px;
}

/* ---------- 목록 도구 ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  padding: 9px 16px; border-radius: 999px;
  border: 2px solid var(--line); background: #fff;
  color: var(--ink-soft); font: inherit; font-size: 14px; font-weight: 800;
  cursor: pointer;
  transition: all .15s ease;
}
.filter-chip:hover { border-color: var(--key); }
.filter-chip.active { background: var(--key); border-color: var(--key); color: #fff; box-shadow: var(--shadow-sm); }
.filter-chip.lv-el.active { background: var(--lv-el); border-color: var(--lv-el); }
.filter-chip.lv-mi.active { background: var(--lv-mi); border-color: var(--lv-mi); }
.filter-chip.lv-hi.active { background: var(--lv-hi); border-color: var(--lv-hi); }
.toolbar select, .toolbar input[type="text"] {
  padding: 10px 14px;
  border: 2px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600;
}
.toolbar select:focus, .toolbar input[type="text"]:focus { outline: none; border-color: var(--key); }
.toolbar input[type="text"] { min-width: 220px; flex: 1; }
#formula-count {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px; font-weight: 800; color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

/* ---------- 문제 풀이 ---------- */
.quiz-progress { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.quiz-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff;
  font-size: 13px; font-weight: 700; color: var(--muted);
}
.quiz-dot.cur { border-color: var(--key); color: var(--key); }
.quiz-dot.ok { background: var(--accent); border-color: var(--accent); color: #fff; }
.quiz-dot.no { background: #e0655a; border-color: #e0655a; color: #fff; }
.choice-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.choice-list button {
  width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
  font: inherit; font-size: 15px; cursor: pointer;
}
.choice-list button:hover:not(:disabled) { background: var(--key-soft); border-color: var(--key); }
.choice-list button:disabled { cursor: default; opacity: .85; }
.choice-list button.picked-ok { background: var(--accent-soft); border-color: var(--accent); }
.choice-list button.picked-no { background: #fdecea; border-color: #e0655a; }
.answer-input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 16px;
}
.feedback { border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; }
.feedback.ok { background: var(--accent-soft); border: 1px solid var(--accent); }
.feedback.no { background: #fdecea; border: 1px solid #e0655a; }
.feedback h3 { margin: 0 0 6px; font-size: 16px; }

/* ---------- 학습지 (인쇄) ---------- */
.ws-sheet { background: #fff; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: 100%; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- 통계 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px;
}
.stat-card .num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--key); }
.stat-card .label { font-size: 13px; color: var(--muted); margin-top: 2px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-row .bar-label { flex: 0 0 110px; font-size: 13px; color: var(--ink-soft); }
.bar-track { flex: 1 1 auto; height: 12px; border-radius: 999px; background: var(--key-soft); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--accent); }
.bar-fill--el { background: var(--lv-el); }
.bar-fill--mi { background: var(--lv-mi); }
.bar-fill--hi { background: var(--lv-hi); }
.bar-row .bar-num { flex: 0 0 40px; text-align: right; font-size: 13px; font-weight: 700; }

/* ---------- 로그인 카드 ---------- */
.login-card {
  max-width: 520px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 28px 24px;
  text-align: center;
}
.login-card .features { text-align: left; margin: 18px 0; padding: 0; list-style: none; }
.login-card .features li { padding: 6px 0; color: var(--ink-soft); font-size: 14px; }
.login-card .note { color: var(--muted); font-size: 13px; margin-top: 16px; }

/* ---------- 푸터 ---------- */
.site-foot {
  margin-top: 40px;
  padding: 36px 24px 40px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: #2b2f36;
  border-top: none;
  color: #b9bfca;
  font-size: 13px;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 14px; }
.foot-links a { color: #e6e9f0; text-decoration: none; font-weight: 600; }
.foot-links a:hover { text-decoration: underline; }
.site-foot p { margin: 0; }

/* ---------- 유틸 ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- 모바일 ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap { padding: 0 14px; }
  h1.page-title { font-size: 22px; }
  .hero h1 { font-size: 24px; }
  .menu-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .level-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .toolbar input[type="text"] { min-width: 0; width: 100%; }
  /* 대시보드 히어로 1열 */
  .hero--split { grid-template-columns: 1fr; padding: 30px 20px; text-align: center; }
  .hero--split .hero-left h1 { text-align: center; }
  .hero--split .hero-left > p { text-align: center; }
  .hero--split .hero-actions { justify-content: center; }
  .hero-actions .btn { flex: 1 1 140px; }
  .mission-stats { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}