/* ── 하루 15분 클로드 ─────────────────────────── */
:root {
  --bg: #FAF9F5;
  --bg-soft: #F0EEE6;
  --card: #FFFFFF;
  --card-soft: #F5F3EC;
  --ink: #29261B;
  --ink-soft: #5C574B;
  --ink-faint: #8B857A;
  --accent: #D97757;
  --accent-deep: #BF5D3E;
  --accent-soft: #F7E8E1;
  --line: #E5E1D6;
  --ok: #3E7C4F;
  --ok-soft: #E5F0E7;
  --warn: #B3541E;
  --code-bg: #2B2924;
  --code-ink: #F0EEE6;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(41, 38, 27, .06), 0 8px 24px rgba(41, 38, 27, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1F1E1A;
    --bg-soft: #26241F;
    --card: #2A2823;
    --card-soft: #312E27;
    --ink: #EDEAE0;
    --ink-soft: #B8B2A5;
    --ink-faint: #8B857A;
    --accent: #E08A6B;
    --accent-deep: #D97757;
    --accent-soft: #3A2E27;
    --line: #3B382F;
    --ok: #7FB98B;
    --ok-soft: #26322A;
    --code-bg: #161512;
    --code-ink: #E8E4D8;
    --shadow: 0 1px 3px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
code, pre { font-family: "SF Mono", ui-monospace, "Noto Sans Mono CJK KR", Menlo, Consolas, monospace; }

/* ── header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 960px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 17px; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 19px; font-weight: 800;
}
.logo-text em { font-style: normal; color: var(--accent-deep); }
.main-nav { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.main-nav a {
  padding: 7px 13px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  color: var(--ink-soft);
}
.main-nav a:hover { background: var(--bg-soft); text-decoration: none; }
.main-nav a.active { background: var(--accent-soft); color: var(--accent-deep); }
.streak-chip {
  font-size: 13.5px; font-weight: 700; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}

/* ── layout ── */
.app-main { max-width: 760px; margin: 0 auto; padding: 28px 20px 60px; }
.loading { color: var(--ink-faint); text-align: center; padding: 60px 0; }

/* ── hero ── */
.hero {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 30px 28px; box-shadow: var(--shadow);
  display: flex; gap: 26px; align-items: center; flex-wrap: wrap;
}
.hero-body { flex: 1; min-width: 240px; }
.hero-kicker { font-size: 13px; font-weight: 800; letter-spacing: .12em; color: var(--accent-deep); text-transform: uppercase; margin-bottom: 6px; }
.hero h1 { font-size: 25px; line-height: 1.4; margin-bottom: 8px; }
.hero p { color: var(--ink-soft); font-size: 15px; }
.progress-ring { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring .track { stroke: var(--bg-soft); }
.progress-ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.progress-ring .label {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  font-weight: 800; font-size: 20px; line-height: 1.15;
}
.progress-ring .label small { display: block; font-size: 11px; font-weight: 600; color: var(--ink-faint); }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border: none; border-radius: 11px;
  padding: 12px 22px; font-size: 15.5px; font-weight: 700;
  transition: transform .12s ease, background .12s ease;
}
.btn:hover { background: var(--accent-deep); text-decoration: none; transform: translateY(-1px); }
.btn.full { width: 100%; justify-content: center; }
.btn.ghost {
  background: transparent; color: var(--ink-soft);
  border: 1.5px solid var(--line);
}
.btn.ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn.sm { padding: 8px 15px; font-size: 13.5px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── section blocks ── */
.home-section { margin-top: 30px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.section-title h2 { font-size: 18.5px; }
.section-title .sub { font-size: 13.5px; color: var(--ink-faint); }

/* today card */
.today-card {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow);
}
.today-card .day-tag { font-size: 12.5px; font-weight: 800; letter-spacing: .1em; opacity: .85; }
.today-card h3 { font-size: 21px; margin: 5px 0 7px; }
.today-card p { font-size: 14px; opacity: .92; margin-bottom: 16px; }
.today-card .btn { background: #fff; color: var(--accent-deep); }
.today-card .btn:hover { background: #F6EDE8; }
.today-done {
  background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 22px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.today-done .big { font-size: 17px; font-weight: 700; }
.today-done p { font-size: 14px; color: var(--ink-soft); }

/* lesson list */
.lesson-list { display: flex; flex-direction: column; gap: 9px; }
.lesson-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 17px; color: var(--ink); transition: border-color .12s, transform .12s;
}
.lesson-row:hover { text-decoration: none; border-color: var(--accent); transform: translateX(3px); }
.lesson-row .num {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 14.5px;
  background: var(--bg-soft); color: var(--ink-soft);
}
.lesson-row.done .num { background: var(--ok-soft); color: var(--ok); }
.lesson-row.next .num { background: var(--accent); color: #fff; }
.lesson-row .info { flex: 1; min-width: 0; }
.lesson-row .t { font-weight: 700; font-size: 15px; }
.lesson-row .d { font-size: 12.5px; color: var(--ink-faint); margin-top: 1px; }
.lesson-row .state { font-size: 12px; font-weight: 700; color: var(--ink-faint); white-space: nowrap; }
.lesson-row.done .state { color: var(--ok); }
.lesson-row.next .state { color: var(--accent-deep); }

.week-block { margin-bottom: 26px; }
.week-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.week-head h3 { font-size: 16px; }
.week-head span { font-size: 12.5px; color: var(--ink-faint); }

/* ── lesson page ── */
.crumb { font-size: 13.5px; color: var(--ink-faint); margin-bottom: 14px; }
.crumb a { color: var(--ink-faint); }
.lesson-head { margin-bottom: 6px; }
.lesson-head .meta { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.chip {
  font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-deep);
}
.chip.grey { background: var(--bg-soft); color: var(--ink-soft); }
.chip.green { background: var(--ok-soft); color: var(--ok); }
.lesson-head h1 { font-size: 26px; line-height: 1.4; margin-bottom: 10px; }
.lesson-head .lede { color: var(--ink-soft); font-size: 15.5px; }

.mode-tabs { display: flex; gap: 6px; margin: 22px 0 4px; background: var(--bg-soft); border-radius: 11px; padding: 4px; }
.mode-tabs button {
  flex: 1; border: none; background: transparent; border-radius: 8px;
  padding: 9px; font-size: 14px; font-weight: 700; color: var(--ink-soft);
}
.mode-tabs button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.article h2 {
  font-size: 19px; margin: 34px 0 12px; padding-top: 20px; border-top: 1px solid var(--line);
}
.article h2:first-child { border-top: none; padding-top: 0; margin-top: 18px; }
.article p { margin-bottom: 13px; font-size: 15.5px; color: var(--ink); }
.article ul, .article ol { margin: 0 0 14px 20px; font-size: 15.5px; }
.article li { margin-bottom: 7px; }
.article strong { color: var(--ink); }
.article code {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; font-size: .86em;
}

.prompt-block { margin: 16px 0; }
.prompt-block .pb-label {
  font-size: 11.5px; font-weight: 800; letter-spacing: .1em; color: var(--ink-faint);
  text-transform: uppercase; margin-bottom: 6px;
}
.prompt-block .pb-label .dot { color: var(--accent); margin-right: 5px; }
.prompt-block pre {
  background: var(--code-bg); color: var(--code-ink);
  border-radius: 11px; padding: 16px 18px; font-size: 13.8px; line-height: 1.8;
  overflow-x: auto; white-space: pre-wrap; word-break: keep-all;
}
.prompt-block .pb-note { font-size: 13px; color: var(--ink-faint); margin-top: 7px; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.compare .side { border-radius: 11px; padding: 15px 17px; font-size: 14.2px; line-height: 1.7; }
.compare .side .tag { font-size: 11.5px; font-weight: 800; margin-bottom: 7px; display: inline-block; padding: 2px 9px; border-radius: 999px; }
.compare .bad { background: color-mix(in srgb, #B3541E 8%, var(--card)); border: 1px solid color-mix(in srgb, #B3541E 25%, var(--line)); }
.compare .bad .tag { background: #B3541E; color: #fff; }
.compare .good { background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--line)); }
.compare .good .tag { background: var(--ok); color: #fff; }
@media (max-width: 620px) { .compare { grid-template-columns: 1fr; } }

.tip {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: 0 11px 11px 0; padding: 13px 17px; margin: 18px 0;
  font-size: 14.5px;
}
.tip .tip-t { font-weight: 800; color: var(--accent-deep); font-size: 12.5px; letter-spacing: .06em; margin-bottom: 3px; }

/* summary card */
.summary-card {
  background: var(--card-soft); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin: 30px 0;
}
.summary-card h3 { font-size: 16px; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.summary-card ul { margin-left: 20px; }
.summary-card li { margin-bottom: 8px; font-size: 15px; }

/* ── quiz ── */
.quiz-wrap { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 26px 0; }
.quiz-wrap h3 { font-size: 17px; margin-bottom: 4px; }
.quiz-wrap .quiz-sub { font-size: 13px; color: var(--ink-faint); margin-bottom: 18px; }
.q-item { margin-bottom: 22px; }
.q-item .q-text { font-weight: 700; font-size: 15.3px; margin-bottom: 10px; }
.q-opt {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  background: var(--bg-soft); border: 1.5px solid transparent; border-radius: 10px;
  padding: 11px 14px; font-size: 14.5px; color: var(--ink); margin-bottom: 7px;
  line-height: 1.55; transition: border-color .1s;
}
.q-opt:hover:not(:disabled) { border-color: var(--accent); }
.q-opt .k {
  font-weight: 800; font-size: 12.5px; flex-shrink: 0; width: 22px; height: 22px;
  border-radius: 7px; display: grid; place-items: center; background: var(--card); margin-top: 1px;
}
.q-opt:disabled { cursor: default; opacity: .88; }
.q-opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.q-opt.wrong { border-color: #B3541E; background: color-mix(in srgb, #B3541E 10%, var(--card)); }
.q-explain {
  font-size: 13.8px; color: var(--ink-soft); background: var(--bg-soft);
  border-radius: 9px; padding: 11px 14px; margin-top: 8px; display: none;
}
.q-explain.show { display: block; }
.quiz-result { text-align: center; padding: 8px 0 2px; }
.quiz-result .score { font-size: 30px; font-weight: 800; color: var(--accent-deep); }
.quiz-result p { font-size: 14px; color: var(--ink-soft); margin: 4px 0 14px; }

/* timer */
.timer-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 8px 6px 15px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.timer-chip button {
  border: none; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800;
  border-radius: 999px; padding: 4px 12px;
}
.timer-chip button.stop { background: var(--ink-soft); }
.timer-chip.over { border-color: var(--accent); color: var(--accent-deep); }

/* lesson footer nav */
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; }
.complete-cta { text-align: center; margin: 30px 0 6px; }
.complete-cta .btn { font-size: 16.5px; padding: 14px 34px; }
.complete-done-msg { text-align: center; color: var(--ok); font-weight: 700; margin: 24px 0 4px; font-size: 15px; }

/* ── flashcards ── */
.flash-deck { position: relative; }
.flash-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 18px;
  min-height: 240px; display: grid; place-items: center; text-align: center;
  padding: 36px 28px; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .15s ease; user-select: none;
}
.flash-card:hover { transform: translateY(-2px); }
.flash-card .face { font-size: 19px; font-weight: 700; line-height: 1.65; }
.flash-card .face .hint { display: block; font-size: 12px; font-weight: 600; color: var(--ink-faint); margin-top: 14px; }
.flash-card .src { position: absolute; top: 14px; left: 18px; font-size: 12px; font-weight: 700; color: var(--ink-faint); }
.flash-ctrl { display: flex; gap: 10px; margin-top: 16px; }
.flash-ctrl .btn { flex: 1; justify-content: center; }
.flash-progress { text-align: center; font-size: 13px; color: var(--ink-faint); margin-top: 12px; font-variant-numeric: tabular-nums; }

/* ── review hub ── */
.review-tabs { display: flex; gap: 6px; background: var(--bg-soft); border-radius: 12px; padding: 5px; margin-bottom: 22px; flex-wrap: wrap; }
.review-tabs button {
  border: none; background: transparent; border-radius: 9px; padding: 9px 15px;
  font-size: 14px; font-weight: 700; color: var(--ink-soft);
}
.review-tabs button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.review-item {
  display: flex; gap: 14px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 9px;
}
.review-item .due-chip { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); white-space: nowrap; }
.review-item .due-chip.soon { background: var(--bg-soft); color: var(--ink-faint); }
.review-item .t { font-weight: 700; font-size: 15px; flex: 1; }
.review-item .t small { display: block; font-weight: 500; color: var(--ink-faint); font-size: 12.5px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 26px; }
.stat-cell { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 15px 10px; text-align: center; }
.stat-cell .v { font-size: 23px; font-weight: 800; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.stat-cell .l { font-size: 12px; color: var(--ink-faint); font-weight: 600; margin-top: 2px; }
@media (max-width: 560px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.empty-state {
  text-align: center; padding: 44px 20px; color: var(--ink-faint);
  background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius);
}
.empty-state .big { font-size: 34px; margin-bottom: 8px; }

/* wrong book */
.wrong-q { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 19px; margin-bottom: 10px; }
.wrong-q .q { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.wrong-q .a { font-size: 14px; }
.wrong-q .a .lab { font-weight: 800; }
.wrong-q .a .yes { color: var(--ok); }
.wrong-q .src-line { font-size: 12px; color: var(--ink-faint); margin-top: 9px; }

/* search */
.search-box {
  width: 100%; border: 1.5px solid var(--line); border-radius: 11px; background: var(--card);
  padding: 12px 16px; font-size: 15px; color: var(--ink); font-family: inherit; margin-bottom: 16px;
}
.search-box:focus { outline: none; border-color: var(--accent); }
.search-box::placeholder { color: var(--ink-faint); }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 700; z-index: 100; box-shadow: var(--shadow);
  animation: toastIn .25s ease; max-width: 90vw; text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.link-btn { border: none; background: none; color: var(--accent-deep); font-size: inherit; padding: 0; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); margin-top: 30px; }
.footer-inner { max-width: 760px; margin: 0 auto; padding: 28px 20px 34px; font-size: 13px; color: var(--ink-soft); }
.footer-inner p { margin-bottom: 8px; }
.footer-links a { margin: 0 2px; }
.footer-meta { color: var(--ink-faint); font-size: 12px; }

@media (max-width: 640px) {
  .header-inner { padding: 10px 14px; gap: 8px; }
  .logo-text { font-size: 15px; }
  .main-nav a { padding: 6px 9px; font-size: 13.5px; }
  .streak-chip { padding: 4px 9px; font-size: 12.5px; }
  .app-main { padding: 20px 16px 50px; }
  .hero { padding: 22px 20px; }
  .hero h1 { font-size: 21px; }
  .lesson-head h1 { font-size: 22px; }
  .quiz-wrap, .summary-card { padding: 18px; }
}
