/* ===== 토큰 (메인과 같은 색 + 주황 포인트) ===== */
:root {
  --teal: #19b8c4;
  --teal-dark: #0e9aa6;
  --accent: #ff5a3c;
  --accent-dark: #e8452a;
  --yellow: #ffd75e;
  --ink: #26323b;
  --muted: #7a8792;
  --line: #e8eef2;
  --bg: #f3f6f8;
  --card: #ffffff;
  --radius: 20px;
  --shadow: 0 6px 22px rgba(34, 60, 80, .07);
  --font-ko: "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-en: "Poppins", "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-ko); color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
.muted { color: var(--muted); font-size: 13px; }

/* ===== 전체 틀 ===== */
.app { display: grid; grid-template-columns: 88px minmax(0, 1fr); min-height: 100vh; }

/* ===== 사이드바 ===== */
.side {
  position: sticky; top: 0; height: 100vh;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 22px 8px; gap: 22px;
}
.side__logo .dot { display: block; width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(135deg, var(--teal), var(--yellow)); }
.side__logo-img { display: block; width: 34px; height: 34px; object-fit: contain; border-radius: 12px; }
.side__nav { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.side__nav a, .side__bottom a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px; border-radius: 14px; color: var(--muted);
  font-size: 11px; transition: background .15s, color .15s;
}
.side svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side__nav a:hover, .side__bottom a:hover { background: #f1f6f8; color: var(--ink); }
.side__nav a.is-active { background: #e4f6f8; color: var(--teal-dark); font-weight: 700; }
.side__bottom { margin-top: auto; width: 100%; }

/* ===== 본문 ===== */
.main { padding: 28px 34px 48px; max-width: 1180px; width: 100%; margin: 0 auto; display: grid; gap: 20px; align-content: start; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.top h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 900; letter-spacing: -.4px; }
.top__sub { color: var(--muted); margin-top: 4px; }
.top__right { display: flex; align-items: center; gap: 14px; }
.pair { display: flex; align-items: flex-end; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px 14px; }
.pair label { display: grid; font-size: 11px; color: var(--muted); gap: 2px; }
.pair select { font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); border: 0; background: transparent; outline: 0; cursor: pointer; padding: 0; }
.pair__arrow { color: var(--teal-dark); font-size: 18px; padding-bottom: 2px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; }

/* ===== 카드 ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.card h3 { font-size: 16px; font-weight: 700; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.grid { display: grid; gap: 20px; }
.grid--hero { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.grid--stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid--charts { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.grid--bottom { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }

/* ===== 버튼/태그/막대 ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 24px; border-radius: 999px; font-weight: 700; font-size: 14.5px; border: 0; cursor: pointer; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-2px); }
.btn--accent { background: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(255, 90, 60, .28); }
.btn--accent:hover { background: var(--accent-dark); }
.btn--soft { background: #eef6f8; color: var(--teal-dark); }
.btn--soft:hover { background: #e0f0f3; }
.btn--wide { width: 100%; margin-top: 14px; }
.tag { background: #fff0ec; color: var(--accent); font-weight: 700; font-size: 12px; padding: 4px 12px; border-radius: 999px; }
.bar { height: 10px; background: #edf2f5; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #5ad3d9); }
.bar--thin { height: 8px; }
.more { color: var(--teal-dark); font-weight: 700; font-size: 13.5px; }

/* ===== 이어서 학습 ===== */
.resume { background: linear-gradient(135deg, #ffffff 0%, #f1fbfc 100%); }
.resume__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.resume h2 { font-size: 22px; font-weight: 900; }
.resume__where { margin: 8px 0 18px; color: #4e5b66; font-size: 14.5px; }
.resume__meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.resume__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* ===== 오늘 목표 링 ===== */
.goal { text-align: center; display: grid; justify-items: center; gap: 12px; align-content: center; }
.ring { position: relative; width: 150px; height: 150px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring__bg { stroke: #edf2f5; }
.ring__fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 314; stroke-dashoffset: calc(314 - 314 * var(--p) / 100); }
.ring__txt { position: absolute; inset: 0; display: grid; place-content: center; }
.ring__txt b { font-family: var(--font-en); font-size: 34px; line-height: 1; }
.ring__txt span { font-size: 12px; color: var(--muted); }

/* ===== 통계 타일 ===== */
.stat { display: grid; gap: 4px; padding: 18px 20px; }
.stat__label { font-size: 12.5px; color: var(--muted); }
.stat__num { font-family: var(--font-en); font-size: 34px; font-weight: 700; line-height: 1.1; }
.stat__num small { font-family: var(--font-ko); font-size: 14px; font-weight: 500; margin-left: 4px; color: var(--muted); }
.stat__hint { font-size: 12.5px; color: var(--muted); }
.stat__hint.up { color: #1a9d6b; }
.stat__hint.down { color: var(--accent); }
.stat--sub { background: linear-gradient(135deg, #fff7e3, #fff); border-color: #ffe9b0; }

/* ===== 주간 막대 ===== */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: end; height: 170px; }
.bars div { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.bars i { width: 100%; max-width: 34px; border-radius: 10px 10px 4px 4px; background: #cfeaf0; }
.bars .today i { background: var(--teal); }
.bars span { font-size: 12px; color: var(--muted); }

/* ===== 오답률 ===== */
.rates { display: grid; gap: 16px; margin-bottom: 16px; }
.rates li { display: grid; grid-template-columns: 82px 1fr 40px; gap: 12px; align-items: center; font-size: 14px; }
.rates .bar i { background: linear-gradient(90deg, #ffb09f, var(--accent)); }
.rates b { text-align: right; font-family: var(--font-en); font-size: 14px; }

/* ===== 코스 ===== */
.courses__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.course { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; border: 1px solid var(--line); transition: background .15s, transform .15s; }
.course:hover { background: #f8fbfc; transform: translateY(-2px); }
.course > div { flex: 1; display: grid; gap: 2px; min-width: 0; }
.course b { font-size: 15px; }
.course .bar { margin-top: 6px; }
.course__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex: none; }
.c-teal { background: #dff5f7; } .c-yellow { background: #fff3c9; } .c-sky { background: #e2f1fa; }

/* ===== 게임 / 구독 ===== */
.games__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.game { display: grid; gap: 2px; padding: 18px; border-radius: 16px; background: #f3f9fa; border: 1px solid #e2f0f3; transition: transform .15s, background .15s; }
.game:hover { transform: translateY(-3px); background: #e6f6f8; }
.game b { font-size: 16px; } .game span { font-size: 12.5px; color: var(--muted); }
.plan__head { display: flex; justify-content: space-between; align-items: center; }
.badge { background: #e2f7ee; color: #1a9d6b; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.plan dl { margin: 14px 0; display: grid; gap: 8px; }
.plan dl div { display: flex; justify-content: space-between; font-size: 14px; }
.plan dt { color: var(--muted); } .plan dd { font-weight: 700; }
.notice { background: #fff8e6; border: 1px solid #ffecb3; color: #8a6a12; border-radius: 12px; padding: 10px 14px; font-size: 13px; }

/* ===== 반응형 ===== */
@media (max-width: 1000px) {
  .grid--hero, .grid--charts, .grid--bottom { grid-template-columns: minmax(0, 1fr); }
  .grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .courses__list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); padding-bottom: 76px; }
  .side {
    position: fixed; z-index: 10; top: auto; bottom: 0; left: 0; right: 0; height: 64px;
    flex-direction: row; justify-content: space-around; padding: 6px 8px; gap: 0;
    border-right: 0; border-top: 1px solid var(--line);
  }
  .side__logo, .side__bottom { display: none; }
  .side__nav { flex-direction: row; justify-content: space-around; }
  .side__nav a { flex: 1; padding: 6px 2px; }
  .main { padding: 18px 16px 28px; }
  .top__right { width: 100%; justify-content: space-between; }
  .pair { flex: 1; }
  .resume__cta .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ===== UI 언어 선택 ===== */
.lang-select {
  font: inherit; font-size: 13px; color: var(--muted);
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; cursor: pointer; outline: 0;
}
.lang-select:hover { color: var(--ink); }

/* 코스별 오답률: 코스 이름을 누르면 해당 코스 틀린 문장 복습 */
.rate__link { color: inherit; text-decoration: none; border-bottom: 1px dashed #b7c6cd; }
.rate__link:hover { color: var(--teal-dark); border-bottom-color: var(--teal-dark); }

/* 계정 메뉴 (아바타 클릭) */
.avatar { cursor: pointer; border: 0; font: inherit; font-weight: 700; }
.acct { position: relative; }
.acct__menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: 0 16px 40px rgba(34, 80, 100, .18); display: grid; gap: 8px; }
.acct__menu[hidden] { display: none; }
.acct__mail { font-size: 13px; color: var(--muted); word-break: break-all; }
.acct__out { border: 1px solid var(--line); background: #f6fafb; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.acct__out:hover { background: #e9f4f6; }
