/* 학습 통계 — 단어 = 파랑, 퀴즈 = 청록 (색 검증: dataviz validate_palette, 이 앱의 카드 표면 기준)
   학습 달력 = 주황 한 색의 4단계 (ordinal 검증 통과) */
:root {
  --viz-words: #2a78d6;
  --viz-quiz: #1baf7a;
  --heat-1: #eba077; --heat-2: #dc7a45; --heat-3: #c4561f; --heat-4: #923c12;
}
@media (prefers-color-scheme: dark) {
  :root {
    --viz-words: #3987e5;
    --viz-quiz: #199e70;
    --heat-1: #8f4722; --heat-2: #b65b2c; --heat-3: #e07037; --heat-4: #f7a675;
  }
}

.vtiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.vtile { background: var(--surface); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.vtile .l { font-size: calc(12.5px * var(--fs)); color: var(--muted); }
.vtile .v { font-size: calc(22px * var(--fs)); font-weight: 700; line-height: 1.2; margin-top: 2px; }
.vtile .v small { font-size: calc(13px * var(--fs)); font-weight: 500; color: var(--muted); margin-left: 2px; }
.vtile .s { font-size: calc(12.5px * var(--fs)); color: var(--muted); margin-top: 2px; word-break: keep-all; }
.vtile.hero { grid-column: 1 / -1; }
.vtile.hero .v { font-size: calc(48px * var(--fs)); }

.vlegend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -4px 0 10px; font-size: calc(13px * var(--fs)); color: var(--muted); }
.vlegend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw.words, .lk.words, .strack i.words { background: var(--viz-words); }
.sw.quiz, .lk.quiz, .strack i.quiz { background: var(--viz-quiz); }

.chart-wrap { position: relative; }
.chart { display: block; max-width: 100%; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--faint); stroke-width: 1; opacity: .6; }
.chart .tick { fill: var(--faint); font-size: calc(11px * var(--fs)); font-family: var(--ko); }
.chart .vlabel { fill: var(--text); font-size: calc(12px * var(--fs)); font-weight: 600; font-family: var(--ko); }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .hit.on, .chart .hit:focus-visible { fill: var(--text); fill-opacity: .06; }
.heat { fill: var(--track); cursor: pointer; outline: none; }
.heat.l1 { fill: var(--heat-1); } .heat.l2 { fill: var(--heat-2); } .heat.l3 { fill: var(--heat-3); } .heat.l4 { fill: var(--heat-4); }
.heat.today { stroke: var(--text); stroke-width: 1.5; }
.heat.on, .heat:focus-visible { stroke: var(--accent); stroke-width: 2; }

.heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 10px; font-size: calc(12px * var(--fs)); color: var(--muted); }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--track); }
.heat-legend i.l1 { background: var(--heat-1); } .heat-legend i.l2 { background: var(--heat-2); }
.heat-legend i.l3 { background: var(--heat-3); } .heat-legend i.l4 { background: var(--heat-4); }
.heat-scale { margin-left: auto; color: var(--faint); }

.vtip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 120px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .15); padding: 8px 10px; font-size: calc(12.5px * var(--fs)); line-height: 1.5;
}
.vtip > b { font-size: calc(16px * var(--fs)); margin-right: 6px; }
.vtip .vt { color: var(--muted); }
.vtip div { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.vtip div strong { color: var(--text); }
.lk { width: 12px; height: 2px; border-radius: 1px; display: inline-block; }

.srow { padding: 12px 0; border-top: 1px solid var(--line); }
.srow:first-of-type { border-top: 0; padding-top: 2px; }
.shead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-weight: 600; font-size: calc(15px * var(--fs)); margin-bottom: 6px; word-break: keep-all; }
.shead .no { font-family: var(--mono); color: var(--accent-text); }
.sprog { margin-left: auto; font-weight: 400; font-size: calc(12.5px * var(--fs)); color: var(--muted); }
.sprog b { color: var(--text); }
.sbar { display: grid; grid-template-columns: 2.6em minmax(0, 1fr) 4.6em; align-items: center; gap: 8px; margin-top: 4px; }
.sk { font-size: calc(12.5px * var(--fs)); color: var(--muted); }
.strack { height: 10px; position: relative; border-left: 1px solid var(--line); }
.strack i { position: absolute; left: 0; top: 1px; bottom: 1px; border-radius: 0 4px 4px 0; }
.sv { font-size: calc(13.5px * var(--fs)); font-weight: 600; text-align: right; white-space: nowrap; }
.sv small { margin-left: 4px; font-weight: 400; font-size: calc(11px * var(--fs)); color: var(--faint); }

.vsub { margin: 4px 0 6px; font-size: calc(13px * var(--fs)); color: var(--muted); }
.miss { list-style: none; margin: 0 0 12px; padding: 0; }
.miss li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.miss li:first-child { border-top: 0; }
.mt { min-width: 0; display: flex; flex-direction: column; }
.me { font-family: var(--mono); font-weight: 500; font-size: calc(15px * var(--fs)); overflow-wrap: anywhere; }
.mq { font-size: calc(14.5px * var(--fs)); word-break: keep-all; overflow-wrap: anywhere; }
.mk { font-size: calc(12.5px * var(--fs)); color: var(--muted); word-break: keep-all; }
.mn { flex: none; font-size: calc(12.5px * var(--fs)); color: var(--muted); }
.mn b { color: var(--bad); }
.miss + .btn { margin-bottom: 14px; }
.vempty { margin: 0; color: var(--muted); font-size: calc(14.5px * var(--fs)); word-break: keep-all; line-height: 1.6; }

.vtable { margin-top: 12px; font-size: calc(13.5px * var(--fs)); }
.vtable summary { cursor: pointer; color: var(--muted); }
.vtable table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.vtable th, .vtable td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.vtable th:first-child, .vtable td:first-child { text-align: left; }
.vtable th { color: var(--muted); font-weight: 600; }

/* 홈의 통계 바로가기 */
.streak-link {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 12px;
  border: 0; background: var(--surface); border-radius: 14px; padding: 11px 14px; box-shadow: var(--shadow);
  font-size: calc(14px * var(--fs)); color: var(--muted); text-align: left;
}
.streak-link svg { width: 20px; height: 20px; color: var(--accent-text); flex: none; }
.streak-link b { color: var(--text); }
.streak-link .go { margin-left: auto; color: var(--accent-text); font-weight: 600; white-space: nowrap; }
.streak-link:active { background: var(--surface-2); }
.today-word {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; width: 100%; margin: 12px 0 0; padding: 12px 14px; text-align: left;
  font: inherit; color: var(--text); background: var(--surface); border: 0; border-radius: 14px; box-shadow: var(--shadow); cursor: pointer;
}
.today-word .tw-l { flex-basis: 100%; font-size: calc(12px * var(--fs)); color: var(--muted); font-weight: 600; }
.today-word .tw-t { font-family: var(--mono); font-size: calc(19px * var(--fs)); font-weight: 600; color: var(--accent-text); overflow-wrap: anywhere; }
.today-word .tw-r { font-size: calc(14px * var(--fs)); color: var(--muted); }
.today-word .tw-m { min-width: 0; font-size: calc(14.5px * var(--fs)); color: var(--muted); }
.today-word .go { margin-left: auto; color: var(--accent-text); font-weight: 600; }
.today-word:active { background: var(--surface-2); }

/* 하루 목표 · 약한 단어 (통계 화면) */
.met-dot { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
.met-key { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; }
.vgoal { margin: -4px 0 10px; font-size: calc(14px * var(--fs)); color: var(--muted); }
.vgoal b { color: var(--text); font-family: var(--mono); }
.vgoal .link { font-size: calc(13.5px * var(--fs)); margin-left: 6px; }
.vgoal + .vtiles { margin-bottom: 0; }
.vgoal + .vtiles .vtile { background: var(--surface-2); box-shadow: none; }
.vlead { margin: -4px 0 8px; font-size: calc(13.5px * var(--fs)); color: var(--muted); }
.me-link { border: 0; background: none; padding: 0; text-align: left; color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.wtag { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px; background: var(--bad-bg); color: var(--bad); font-weight: 600; }
