@layer legacy {
/* ── 실적노트 토스식 첫 화면과 주제 페이지 (2026-10-25, stats-sections-view.js) ──
   The settle sentence sits on the page itself (토스식, 2026-10-26); the sections below are rounded cards in the gutter.
   One sentence in large type per section; numbers inside it are bold, never animated (결론은 처음부터).
   Pictures grow once on screen: bars and tracks from 0 to --h on the snappy spring, the line draws. */

.view-stats .stats-sections { display: flex; flex-direction: column; gap: 14px; }
.view-stats .stats-sections[hidden] { display: none; }
.view-stats .stats-sec { display: flex; flex-direction: column; gap: 14px; padding: 22px 20px 16px; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-summary); min-width: 0; }
/* 이번 정산: the one sentence on the page itself, no card, so the first screen reads text above and cards below. */
.view-stats .stats-sec-settle { gap: 16px; padding: 8px 4px 24px; border-radius: 0; background: transparent; box-shadow: none; }
.view-stats .stats-sec-settle .stats-sec-viz { margin-top: 2px; }
.view-stats .stats-sec-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-body); font-weight: 700; }
.view-stats .stats-sec-icon { width: 26px; height: 26px; padding: 6px; flex: none; border-radius: 50%; background: var(--panel2); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.view-stats .stats-sec-hero { margin: 0; font-size: var(--fs-hero); font-weight: 800; line-height: 1.3; letter-spacing: -0.025em; white-space: pre-line; color: var(--text); }
.view-stats .stats-sec-line { margin: -4px 0 0; font-size: var(--fs-headline); font-weight: 800; line-height: 1.38; letter-spacing: -0.02em; white-space: pre-line; color: var(--text); }
.view-stats .stats-sec-title { margin: 0; font-size: var(--fs-title-xl); font-weight: 800; letter-spacing: -0.02em; }
.view-stats :is(.stats-sec-hero, .stats-sec-line, .stats-topic-line) b { color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; }
.view-stats .stats-sec-basis { margin: 0; color: var(--muted); font-size: var(--fs-body); font-weight: 500; line-height: 1.5; }
/* 2026-10-27 phone test: Korean wraps by 어절 and lines balance, so no lone "있어요" or "4일" line. */
.view-stats :is(.stats-sec-hero, .stats-sec-line, .stats-topic-line) { word-break: keep-all; text-wrap: balance; }
.view-stats :is(.stats-sec-basis, .stats-sec-why) { word-break: keep-all; text-wrap: balance; }
.view-stats .stats-sec-why { margin: 0; color: var(--text-sub); font-size: var(--fs-title); line-height: 1.5; }
.view-stats .stats-sec-fine { margin: 0; color: var(--muted); font-size: var(--fs-body); line-height: 1.6; text-align: center; }
/* 더 보기: a quiet row on the card's second surface, label left, hint and chevron right (not the shared pill button). */
.view-stats .stats-sec-more { display: flex; width: 100%; min-height: 48px; margin: 2px 0 0; padding: 0 14px 0 16px; align-items: center; border: 0; border-radius: var(--r-md); background: var(--panel2); color: var(--text); font: 700 var(--fs-body-l) var(--font-ui); text-align: left; cursor: pointer; }
.view-stats .stats-sec-more:active { background: var(--btn-fill-pressed, var(--panel3)); }
.view-stats .stats-sec-more:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.view-stats .stats-sec-more::after { content: ""; flex: none; width: 7px; height: 7px; margin-left: 12px; border-top: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); transform: rotate(45deg); }
.view-stats .stats-sec-more-in { display: flex; flex: 1; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; }
.view-stats .stats-sec-more-in small { color: var(--muted); font-size: var(--fs-body); font-weight: 500; white-space: nowrap; }
.view-stats .stats-sec-start { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text-sub); font-size: var(--fs-body-l); }

/* 요즘 달라진 점 */
.view-stats .stats-changes { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.view-stats .stats-changes li { display: flex; gap: 12px; align-items: flex-start; }
.view-stats .stats-changes li > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.view-stats .stats-changes b { font-size: var(--fs-title-m); font-weight: 700; line-height: 1.4; }
.view-stats .stats-changes small { color: var(--muted); font-size: var(--fs-body); }
.view-stats .stats-changes-icon { display: flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-md); background: var(--panel2); color: var(--text-sub); }

/* 나의 기록 rows */
.view-stats .stats-sec-rows { display: flex; flex-direction: column; }
.view-stats .stats-sec-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0; border: 0; background: none; color: inherit; text-align: left; font: inherit; }
.view-stats .stats-sec-row + .stats-sec-row { box-shadow: inset 0 1px 0 var(--line); }
.view-stats .stats-sec-row > span { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.view-stats .stats-sec-row b { font-size: var(--fs-title-m); font-weight: 700; }
.view-stats .stats-sec-row small { color: var(--muted); font-size: var(--fs-body); }
.view-stats .stats-sec-row > strong { color: var(--text-sub); font-size: var(--fs-body-l); font-weight: 700; white-space: nowrap; }
.view-stats .stats-sec-row > strong small { font-size: var(--fs-label); }

/* 체험 */
.view-stats .stats-trial-steps { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.view-stats .stats-trial-steps li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding-bottom: 16px; position: relative; }
.view-stats .stats-trial-steps li:not(:last-child)::before { content: ""; position: absolute; left: 21px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.view-stats .stats-trial-steps li > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.view-stats .stats-trial-steps b { font-size: var(--fs-title-m); font-weight: 700; }
.view-stats .stats-trial-steps small { color: var(--muted); font-size: var(--fs-body); }
.view-stats .stats-trial-day { display: flex; align-items: center; justify-content: center; height: 26px; border-radius: var(--r-full); background: var(--primary-bg); color: var(--gold); font-size: var(--fs-label); font-weight: 700; }
.view-stats .stats-trial-steps li.is-first .stats-trial-day { background: var(--gold); color: var(--gold-ink); }

/* Topic pages: the same grammar, one block per item. */
/* A long nowrap line (a zone row's meta) ellipsizes inside its card instead of widening the page (2026-11-26). */
.view-stats .stats-page, .view-stats .stats-home { grid-template-columns: minmax(0, 1fr); }
.view-stats .stats-topic { display: flex; flex-direction: column; gap: 12px; }
.view-stats .stats-topic-block { display: flex; flex-direction: column; gap: 12px; padding: 24px 20px; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-summary); min-width: 0; }
/* A 요즘 나 tile opens its page at its block (2026-11-07): the block stops below the status bar, not under it. */
.view-stats .stats-topic-block { scroll-margin-top: max(16px, calc(env(safe-area-inset-top, 0px) + 12px)); }
.view-stats .stats-topic-line { margin: -4px 0 0; font-size: var(--fs-display-s); font-weight: 800; line-height: 1.4; letter-spacing: -0.02em; white-space: pre-line; }
.view-stats .stats-sample-tag { margin-left: 6px; padding: 2px 8px; border-radius: var(--r-full); background: var(--primary-bg); color: var(--gold); font-size: var(--fs-label); font-style: normal; font-weight: 700; }

/* Pictures. Every value starts at 0 and reaches --h when .is-drawn is set. */
.view-stats .stats-sec-viz { min-width: 0; }
.view-stats .stats-viz-bars { display: flex; align-items: flex-end; gap: 5px; height: 96px; padding-bottom: 1px; box-shadow: inset 0 -1px 0 var(--line); }
.view-stats .stats-viz-bars > i { flex: 1; height: 0; border-radius: 4px 4px 1px 1px; background: color-mix(in srgb, var(--text) 10%, transparent); transition: height var(--spring-snappy-ms) var(--spring-snappy); }
.view-stats .stats-viz-bars > i.is-on { background: linear-gradient(180deg, var(--gold), var(--gold2)); }
.view-stats .stats-viz-bars > i.is-empty { height: 4px; background: var(--panel2); }
.view-stats .is-drawn .stats-viz-bars > i:not(.is-empty) { height: var(--h); }
.view-stats .stats-viz-ticks { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: var(--fs-label); font-weight: 500; }
.view-stats .stats-viz-ticks .is-on { color: var(--gold); font-weight: 700; }
.view-stats .stats-viz-line { display: block; width: 100%; height: 96px; overflow: visible; }
.view-stats .stats-viz-line polyline { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.view-stats .stats-viz-line polyline.is-end { stroke-width: 10; }
/* The line is revealed left to right; a dash would break with a non-scaling stroke. */
.view-stats .stats-viz-line { clip-path: inset(-8px 100% -8px -8px); transition: clip-path var(--spring-smooth-ms) var(--spring-smooth); }
.view-stats .is-drawn .stats-viz-line { clip-path: inset(-8px -8px -8px -8px); }
.view-stats :is(.stats-viz-duel, .stats-viz-rows) { display: flex; flex-direction: column; gap: 10px; }
.view-stats .stats-viz-duel-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.view-stats .stats-viz-rows .stats-viz-duel-row { grid-template-columns: 76px minmax(0, 1fr) auto; }
.view-stats .stats-viz-duel-row > span { color: var(--muted); font-size: var(--fs-body); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-stats .stats-viz-code { font-family: var(--font-code); }
.view-stats .stats-viz-duel-row > i { height: 28px; border-radius: var(--r-sm); background: var(--panel2); overflow: hidden; }
/* 2026-11-03 phone review: ranking rows (세부구역 속도, 구역별) read as thin tracks, like the mockup. */
.view-stats .stats-viz-rows .stats-viz-duel-row > i, .view-stats .stats-viz-rows .stats-viz-duel-row > i > b { height: 8px; border-radius: var(--r-full); }
.view-stats .stats-viz-rows .stats-viz-duel-row > i > b { height: 100%; }
.view-stats .stats-viz-duel-row > i > b { display: block; width: 0; height: 100%; border-radius: var(--r-sm); background: color-mix(in srgb, var(--text) 18%, transparent); transition: width var(--spring-snappy-ms) var(--spring-snappy); }
.view-stats .stats-viz-duel-row.is-on > i > b { background: var(--gold); }
.view-stats .is-drawn .stats-viz-duel-row > i > b { width: var(--h); }
.view-stats .stats-viz-duel-row > strong { min-width: 56px; text-align: right; font-size: var(--fs-body-l); font-weight: 700; font-variant-numeric: tabular-nums; }
.view-stats .stats-viz-duel-row:not(.is-on) > strong { color: var(--muted); }
/* 세부구역 속도 (2026-11-04 mockup): thin tracks, the day's average as one dashed line through every row,
   faster-than-average rows coloured, ▲▼ against the last time. */
.view-stats .stats-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.view-stats .stats-sec-unit { flex: none; color: var(--muted); font-size: var(--fs-label); font-weight: 500; }
.view-stats .stats-viz-pace { display: flex; flex-direction: column; }
.view-stats .stats-viz-pace-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 28px 40px; align-items: center; gap: 10px; min-height: 40px; }
.view-stats .stats-viz-pace-avg { min-height: 20px; }
/* 한 집에 몇 개 (2026-11-22): "1.52개" needs a wider value column and has no change column */
.view-stats .stats-viz-pace.is-wide .stats-viz-pace-row { grid-template-columns: 72px minmax(0, 1fr) 52px; }
.view-stats .stats-viz-pace.is-wide .stats-viz-pace-row > :nth-child(4) { display: none; }
.view-stats .stats-viz-pace-track { position: relative; display: flex; align-items: center; align-self: stretch; }
.view-stats .stats-viz-pace-row:not(.stats-viz-pace-avg) .stats-viz-pace-track::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--at); border-left: 1.5px dashed color-mix(in srgb, var(--text) 40%, transparent); }
.view-stats .stats-viz-pace-avg b { position: absolute; bottom: 2px; left: var(--at); transform: translateX(-50%); color: var(--muted); font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.view-stats .stats-viz-pace-track > i { display: block; width: 100%; height: 8px; border-radius: var(--r-full); background: var(--panel2); overflow: hidden; }
.view-stats .stats-viz-pace-track > i > b { display: block; width: 0; height: 100%; border-radius: var(--r-full); background: color-mix(in srgb, var(--text) 24%, transparent); transition: width var(--spring-snappy-ms) var(--spring-snappy); }
.view-stats .stats-viz-pace-row.is-fast .stats-viz-pace-track > i > b { background: var(--gold); }
.view-stats .is-drawn .stats-viz-pace-track > i > b { width: var(--h); }
.view-stats .stats-viz-pace-row > .stats-viz-code { font-size: var(--fs-body); font-weight: 600; color: var(--text); }
.view-stats .stats-viz-pace-row > strong { text-align: right; font-size: var(--fs-body-l); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.view-stats .stats-viz-pace-row.is-fast > strong { color: var(--text); }
.view-stats .stats-viz-change { text-align: right; color: var(--muted); font-size: var(--fs-label); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.view-stats .stats-viz-change.is-up { color: var(--gold); }
.view-stats .stats-viz-change.is-down { color: var(--red); }
.view-stats .stats-viz-range-track, .view-stats .stats-viz-band-track { position: relative; height: 28px; border-radius: var(--r-sm); background: var(--panel3); box-shadow: inset 0 1px 2px rgba(0,0,0,.14); }
.view-stats .stats-viz-range-dot { position: absolute; top: -4px; bottom: -4px; left: var(--at); width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--gold); }
.view-stats .stats-viz-band-work { position: absolute; top: 0; bottom: 0; left: var(--from); width: 0; border-radius: var(--r-sm); background: var(--gold); transition: width var(--spring-snappy-ms) var(--spring-snappy); }
.view-stats .is-drawn .stats-viz-band-work { width: calc(var(--to) - var(--from)); }
.view-stats .stats-viz-band-gap { position: absolute; top: 0; bottom: 0; left: var(--from); width: calc(var(--to) - var(--from));
  background: repeating-linear-gradient(135deg, var(--panel) 0 3px, color-mix(in srgb, var(--gold) 40%, transparent) 3px 6px); }
.view-stats .stats-viz-progress { position: relative; height: 12px; border-radius: var(--r-full); background: var(--panel3); box-shadow: inset 0 1px 2px rgba(0,0,0,.18); }
.view-stats .stats-viz-progress > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: var(--r-full); transition: width var(--spring-snappy-ms) var(--spring-snappy); }
.view-stats .stats-viz-progress > .is-projected { background: color-mix(in srgb, var(--gold) 24%, transparent); }
.view-stats .stats-viz-progress > .is-now { background: linear-gradient(90deg, var(--gold2), var(--gold)); }
.view-stats .is-drawn .stats-viz-progress > :is(.is-projected, .is-now) { width: var(--h); }
.view-stats .stats-viz-progress > .is-target { left: var(--at); top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--text); transition: none; }

@media (prefers-reduced-motion: reduce) {
  .view-stats :is(.stats-viz-bars > i, .stats-viz-duel-row > i > b, .stats-viz-pace-track > i > b, .stats-viz-band-work, .stats-viz-progress > i, .stats-viz-line) { transition: none; }
}

/* ── 지난 업무가 주인공 (2026-11-03) ──
   The latest day leads: 시급 (or 매출 for a 매출노트 day) in hero type, three facts, the 15-minute households.
   이번 정산 becomes a small card; the topic sections are one list of rows. */
.view-stats .stats-latest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.view-stats .stats-latest-zone { flex: none; color: var(--muted); font: 600 var(--fs-label) var(--font-code); letter-spacing: .01em; }
.view-stats .stats-latest-hero { display: flex; flex-direction: column; gap: 2px; }
.view-stats .stats-latest-hero > span { color: var(--muted); font-size: var(--fs-body); font-weight: 600; }
.view-stats .stats-latest-hero h2 { display: flex; align-items: baseline; gap: 2px; margin: 0; }
.view-stats .stats-latest-hero h2 b { color: var(--gold); font: 800 var(--fs-hero) var(--font-amount); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.view-stats .stats-latest-hero h2 small, .view-stats .stats-settle-amount small { color: var(--muted); font-size: var(--fs-title-m); font-weight: 600; }
.view-stats .stats-latest-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.view-stats .stats-latest-facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.view-stats .stats-latest-facts dt { color: var(--muted); font-size: var(--fs-label); font-weight: 500; }
.view-stats .stats-latest-facts dd { margin: 0; white-space: nowrap; }
.view-stats .stats-latest-facts dd b { font: 700 var(--fs-title-l) var(--font-numeric); letter-spacing: -0.022em; font-variant-numeric: tabular-nums; }
.view-stats .stats-latest-facts dd > b:not(.stats-numeric) { font: 700 var(--fs-title-m) var(--font-ui); }
.view-stats .stats-latest-facts dd small { color: var(--muted); font-size: var(--fs-label); font-weight: 500; }
.view-stats .stats-latest-facts .stats-latest-extra { display: block; margin-top: 2px; }
.view-stats .stats-latest-note { margin: 0 0 -6px; color: var(--muted); font-size: var(--fs-label); font-weight: 500; }
.view-stats .stats-findings { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.view-stats .stats-findings li { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; }
.view-stats .stats-findings li + li { box-shadow: inset 0 1px 0 var(--line); }
.view-stats .stats-findings li:last-child { padding-bottom: 4px; }
.view-stats .stats-findings b { font-size: var(--fs-title); font-weight: 600; line-height: 1.45; word-break: keep-all; }
.view-stats .stats-findings b b { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.view-stats .stats-findings small { color: var(--muted); font-size: var(--fs-body); }
.view-stats .stats-sec-settle.is-compact { gap: 8px; padding: 22px 20px 16px; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-summary); }
.view-stats .stats-settle-amount { display: flex; align-items: baseline; gap: 2px; margin: 0; }
.view-stats .stats-settle-amount b { font: 800 var(--fs-display-m) var(--font-amount); letter-spacing: -0.024em; font-variant-numeric: tabular-nums; }
.view-stats .stats-sec-list { padding: 4px 20px; }
.view-stats .stats-latest-finding { display: flex; flex-direction: column; gap: 2px; margin: -4px 0 0; }
.view-stats .stats-latest-finding b { font-size: var(--fs-title); font-weight: 600; line-height: 1.45; word-break: keep-all; }
.view-stats .stats-latest-finding b b { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.view-stats .stats-latest-finding small { color: var(--muted); font-size: var(--fs-body); }
.view-stats .stats-latest-bars > i.is-gap { height: 100%; background: repeating-linear-gradient(135deg, var(--line) 0 3px, transparent 3px 6px); }

/* ── 2026-11-04 동작 시안: 막대 눌러 읽기, 시간 눈금, 이번 정산 카드, 요즘 나 타일, 정산별 기둥, 연속 근무, 구역 정렬, 최고 기록 ──
   Motion follows DESIGN-RULES 5절: bars on the snappy spring after the card shows, presses on the 150ms token,
   a segment switch settles its rows from a light fade, and the counted numbers roll once on screen. */
.view-stats .stats-viz-readout { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-height: 28px; margin: 0 0 6px; padding: 4px 10px; border-radius: var(--r-md); background: var(--panel2); }
.view-stats .stats-viz-readout > span { color: var(--text); font-size: var(--fs-body); font-weight: 600; }
.view-stats .stats-viz-readout > b { color: var(--gold); font: 700 var(--fs-title-m) var(--font-numeric); font-variant-numeric: tabular-nums; white-space: nowrap; }
.view-stats .stats-viz-bars.is-tappable > button { display: flex; flex: 1; align-items: flex-end; height: 100%; min-width: 0; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; }
.view-stats .stats-viz-bars.is-tappable > button > i { display: block; width: 100%; height: 0; border-radius: 4px 4px 1px 1px; background: color-mix(in srgb, var(--text) 10%, transparent); transition: height var(--spring-snappy-ms) var(--spring-snappy), background var(--motion-press-ms); }
.view-stats .stats-viz-bars.is-tappable > button > i.is-on { background: linear-gradient(180deg, var(--gold), var(--gold2)); }
.view-stats .stats-viz-bars.is-tappable > button > i.is-empty { height: 4px; background: var(--panel2); }
.view-stats .stats-viz-bars.is-tappable > button > i.is-gap { height: 100%; background: repeating-linear-gradient(135deg, var(--line) 0 3px, transparent 3px 6px); }
.view-stats .is-drawn .stats-viz-bars.is-tappable > button > i:not(.is-empty) { height: var(--h); }
.view-stats .stats-viz-bars.is-tappable > button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.view-stats .stats-flow-ticks { display: grid; grid-template-columns: repeat(var(--slots), minmax(0, 1fr)); gap: 5px; margin-top: 6px; color: var(--muted); font-size: var(--fs-caption); }
.view-stats .stats-flow-ticks > span { min-width: 0; height: 16px; padding-left: 2px; border-left: 1px solid color-mix(in srgb, var(--muted) 40%, transparent); white-space: nowrap; overflow: visible; }
.view-stats .stats-viz-duel-row.is-muted > strong { color: var(--muted); font-weight: 600; }
.view-stats .stats-viz-duel-row.is-muted > i > b { background: color-mix(in srgb, var(--gold) 35%, transparent); }
.view-stats button.stats-viz-duel-row { width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.view-stats .stats-row-tag { margin-left: 6px; padding: 1px 6px; border-radius: var(--r-full); background: var(--primary-bg); color: var(--gold); font-size: var(--fs-caption); font-style: normal; font-weight: 600; vertical-align: middle; white-space: nowrap; }

/* 이번 정산: 이대로 가면 · 휴무 −/+ · 지난 정산보다 · 순수익 */
.view-stats .stats-sec-settle.is-card { gap: 14px; padding: 22px 20px 6px; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-summary); }
.view-stats .stats-settle-project { display: flex; flex-direction: column; gap: 8px; }
.view-stats .stats-settle-amount .stats-unit.is-lead { margin: 0 2px 0 0; }
/* 2026-12-03: 이대로 가면이 첫 화면 맨 위다. 두 칸(목표까지 하루 · 지난 정산보다)과 휴무 줄은 카드 폭 끝까지 줄로 나누고,
   휴무 −/+는 줄을 누르면 그 아래로 펼친다. */
.view-stats .stats-settle-facts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 6px -20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.view-stats .stats-settle-fact { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; margin: 0; padding: 12px 16px 12px 20px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; transition: background-color var(--motion-press-ms); }
.view-stats .stats-settle-fact + .stats-settle-fact { padding: 12px 20px 12px 16px; border-left: 1px solid var(--line); }
.view-stats button.stats-settle-fact { cursor: pointer; }
.view-stats button.stats-settle-fact:active { background: var(--btn-fill-pressed, var(--panel2)); }
.view-stats .stats-settle-fact-k { color: var(--muted); }
.view-stats .stats-settle-fact > .stats-tile-chev { position: absolute; top: 18px; right: 22px; margin: 0; border-color: var(--muted); border-width: 1.5px 1.5px 0 0; width: 7px; height: 7px; }
/* 목표가 없거나 이미 채웠으면 한 칸: 이름과 근거는 왼쪽, 금액은 오른쪽. */
.view-stats .stats-settle-fact:only-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 12px 20px; }
.view-stats .stats-settle-fact:only-child > .stats-settle-fact-v { grid-column: 2; grid-row: 1 / span 2; }
.view-stats button.stats-settle-fact:only-child { padding-right: 40px; }
.view-stats .stats-settle-fact:only-child > .stats-tile-chev { top: calc(50% - 4px); }
.view-stats .stats-settle-fact-v { color: var(--muted); white-space: nowrap; }
.view-stats .stats-settle-fact-v b { color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.view-stats .stats-settle-fact-v b.is-up { color: var(--gold); }
.view-stats .stats-settle-fact-v b.is-down { color: var(--red); }
.view-stats .stats-settle-fact-v .stats-unit { margin: 0 2px; }
.view-stats .stats-settle-fact-v .stats-unit.is-lead { margin-left: 0; }
.view-stats .stats-settle-fact > small { color: var(--muted); white-space: nowrap; }
.view-stats .stats-settle-fold { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin: -8px 0 0; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.view-stats .stats-settle-fold .stats-tile-chev { width: 7px; height: 7px; margin: -4px 2px 0 0; border-color: var(--muted); border-width: 1.5px 1.5px 0 0; transform: rotate(135deg); transition: transform var(--spring-quick-ms) var(--spring-quick); }
.view-stats .stats-settle-fold[aria-expanded="true"] .stats-tile-chev { margin-top: 4px; transform: rotate(-45deg); }
.view-stats :is(.stats-settle-fold, button.stats-settle-fact):focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; border-radius: var(--r-sm); }
.view-stats .stats-settle-foldbody { display: grid; grid-template-rows: 0fr; margin-top: -8px; transition: grid-template-rows var(--spring-quick-ms) var(--spring-quick); }
.view-stats .stats-settle-fold[aria-expanded="true"] + .stats-settle-foldbody { grid-template-rows: 1fr; }
.view-stats .stats-settle-sim { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 0; overflow: hidden; }
.view-stats .stats-settle-sim small { flex: 1 1 0%; min-width: 0; color: var(--muted); line-height: 1.5; word-break: keep-all; white-space: pre-line; }
.view-stats .stats-settle-sim > * { margin-bottom: 14px; }
.view-stats .stats-settle-sim .stats-settle-steps .stats-sim-step { background: var(--panel2); box-shadow: none; }
.view-stats .stats-settle-steps { display: flex; flex: none; gap: 8px; }
.view-stats .stats-settle-steps .stats-sim-step, .view-stats .stats-day-nav .stats-sim-step { width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: var(--r-full); background: var(--panel); box-shadow: 0 1px 2px rgba(0,0,0,.14); color: var(--text); font: 600 20px/1 var(--font-ui); cursor: pointer; transition: transform var(--motion-press-ms); }
.view-stats :is(.stats-settle-steps, .stats-day-nav) .stats-sim-step:active { transform: scale(.96); }
.view-stats :is(.stats-settle-steps, .stats-day-nav) .stats-sim-step:disabled { color: var(--muted); opacity: .45; cursor: default; }
.view-stats .stats-settle-compare { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 12px 0 6px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: filter var(--motion-press-ms); }
.view-stats .stats-settle-compare:active { filter: brightness(.96); }
.view-stats .stats-settle-compare-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: var(--fs-title); font-weight: 600; }
.view-stats .stats-settle-compare-head b { font-size: var(--fs-title-m); font-weight: 700; white-space: nowrap; }
.view-stats .stats-settle-compare-head b.is-up { color: var(--gold); }
.view-stats .stats-settle-compare-head b.is-down { color: var(--red); }
.view-stats .stats-settle-compare .stats-sec-viz { display: block; }
.view-stats .stats-settle-compare .stats-viz-duel-row > i, .view-stats .stats-settle-compare .stats-viz-duel-row > i > b { height: 8px; border-radius: var(--r-full); }
.view-stats .stats-settle-compare .stats-viz-duel-row > strong { font-size: var(--fs-body); }
.view-stats .stats-settle-compare .stats-sec-basis { word-break: keep-all; }
.view-stats .stats-settle-compare-note { padding-top: 10px; border-top: 1px solid var(--line); }
.view-stats .stats-settle-net { margin: 0 -20px; padding: 0 20px; min-height: 52px; box-shadow: inset 0 1px 0 var(--line); cursor: pointer; }

/* 요즘 나: 주제 카드 (2026-11-10 구성 시안). 카드 하나가 주제 페이지 하나다. 아래 타일 막대는 카드의 작은 그림으로 쓴다. */
.view-stats .stats-sec-topics { gap: 12px; padding: 0; background: transparent; box-shadow: none; }
.view-stats .stats-sec-topics > .stats-sec-head { padding: 10px 4px 0; }
.view-stats .stats-topic-cards { display: grid; gap: 12px; }
.view-stats .stats-topic-card { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; padding: 16px 18px; border: 0; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-summary); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: filter var(--motion-press-ms); }
.view-stats .stats-topic-card:active { filter: brightness(.96); }
.view-stats .stats-topic-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.view-stats .stats-topic-card.is-folded { gap: 4px; padding: 14px 18px; background: color-mix(in srgb, var(--text) 4%, transparent); box-shadow: none; }
.view-stats .stats-topic-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); }
.view-stats .stats-topic-card-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-width: 0; }
.view-stats :is(.stats-topic-card-lead, .stats-topic-card-side) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.view-stats .stats-topic-card-side { flex: none; align-items: flex-end; text-align: right; }
.view-stats :is(.stats-topic-card-v, .stats-topic-card-s) { display: flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.view-stats :is(.stats-topic-card-k, .stats-topic-card-note, .stats-topic-card-v > small, .stats-topic-card-s > small) { color: var(--muted); }
.view-stats .stats-topic-card-note { word-break: keep-all; }
.view-stats .stats-topic-card-note.is-up { color: var(--gold); }
.view-stats .stats-topic-card-note.is-down { color: var(--red); }
.view-stats .stats-topic-card-side .stats-topic-card-s > b.stats-viz-code { color: var(--gold); }
.view-stats .stats-topic-card-viz { flex: none; width: 96px; }
.view-stats .stats-topic-card-viz .stats-tile-bars { height: 44px; gap: 3px; }
.view-stats .stats-topic-spark { flex: none; width: 92px; height: 44px; overflow: visible; }
.view-stats .stats-topic-spark polyline { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.view-stats .stats-topic-spark circle { fill: var(--gold); }
.view-stats .stats-topic-card-subs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 10px; box-shadow: inset 0 1px 0 var(--line); }
.view-stats .stats-topic-card-subs > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* 요즘 나: 타일 12개, 두 칸 (2026-11-10까지; 막대 규칙은 주제 카드가 쓴다) */
.view-stats .stats-tile-bars { display: flex; align-items: flex-end; gap: 2px; height: 22px; }
.view-stats .stats-tile-bars > i { flex: 1; min-width: 0; height: 0; border-radius: 2px; background: color-mix(in srgb, var(--text) 12%, transparent); transition: height var(--spring-snappy-ms) var(--spring-snappy); }
.view-stats .stats-tile-bars > i.is-on { background: var(--gold); }
.view-stats .stats-tile-bars > i.is-empty { height: 2px; background: var(--panel2); }
.view-stats .is-drawn .stats-tile-bars > i:not(.is-empty) { height: var(--h); }
.view-stats .stats-tile-bars.is-band > i { height: 10px; background: var(--panel3); transition: none; }
.view-stats .stats-tile-bars.is-band > i.is-on { background: var(--gold); }

/* 정산별·건당·프레시백 기둥: 값 위, 이름 아래 */
.view-stats .stats-viz-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; height: 84px; align-items: end; }
.view-stats .stats-viz-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 84px; min-width: 0; }
.view-stats .stats-viz-col-value { color: var(--muted); font-size: var(--fs-caption); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.view-stats .stats-viz-col.is-on .stats-viz-col-value { color: var(--text); }
.view-stats .stats-viz-col > i { display: block; width: 100%; height: 0; border-radius: 3px; background: color-mix(in srgb, var(--text) 12%, transparent); transition: height var(--spring-snappy-ms) var(--spring-snappy); }
.view-stats .stats-viz-col.is-on > i { background: var(--gold); }
.view-stats .stats-viz-col.is-best > i { background: color-mix(in srgb, var(--gold) 45%, transparent); }
.view-stats .is-drawn .stats-viz-col > i { height: calc(var(--h) * .5); }
.view-stats .stats-viz-col-label { color: var(--muted); font-size: var(--fs-caption); white-space: nowrap; }

/* 연속 근무 칸 */
.view-stats .stats-viz-cells { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.view-stats .stats-viz-cells > span { display: flex; align-items: center; justify-content: center; height: 28px; border-radius: var(--r-sm); background: var(--panel2); color: var(--muted); font: 600 var(--fs-caption) var(--font-numeric); }
.view-stats .stats-viz-cells > span.is-on { background: var(--gold); color: var(--gold-ink); }

/* 자주 맡는 구역: 횟수·물량·매출 정렬 */
.view-stats .stats-viz-zonelist { display: flex; flex-direction: column; gap: 8px; }
.view-stats .stats-viz-sort { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 2px; width: calc(var(--n, 3) * 60px); max-width: 100%; margin-left: auto; padding: 2px; border-radius: 9px; background: var(--panel2); }
.view-stats .stats-viz-sort > button { min-height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--text-sub); font: 600 var(--fs-label) var(--font-ui); cursor: pointer; transition: background var(--motion-press-ms), color var(--motion-press-ms), box-shadow var(--motion-press-ms); }
.view-stats .stats-viz-sort > button.is-on { background: var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.12); color: var(--text); font-weight: 700; }
.view-stats .stats-viz-zonelist-rows { display: flex; flex-direction: column; }
.view-stats .stats-viz-zonelist-rows.is-settling { animation: stats-settle var(--spring-quick-ms) var(--spring-quick) both; }
@keyframes stats-settle { from { opacity: .6; } to { opacity: 1; } }
.view-stats .stats-zone-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; margin: 0; padding: 10px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
.view-stats button.stats-zone-row { cursor: pointer; transition: filter var(--motion-press-ms); }
.view-stats button.stats-zone-row:active { filter: brightness(.96); }
.view-stats .stats-zone-row + .stats-zone-row { box-shadow: inset 0 1px 0 var(--line); }
.view-stats .stats-zone-row-main { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.view-stats .stats-zone-row-main .stats-viz-code { font-size: var(--fs-body-l); font-weight: 700; }
.view-stats .stats-zone-row-main small { color: var(--muted); font-size: var(--fs-label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-stats .stats-zone-row-main > i { display: block; width: 100%; height: 6px; margin-top: 3px; border-radius: var(--r-full); background: var(--panel2); overflow: hidden; }
.view-stats .stats-zone-row-main > i > b { display: block; width: 0; height: 100%; border-radius: var(--r-full); background: color-mix(in srgb, var(--text) 24%, transparent); transition: width var(--spring-snappy-ms) var(--spring-snappy); }
.view-stats .stats-zone-row.is-on .stats-zone-row-main > i > b { background: var(--gold); }
.view-stats .is-drawn .stats-zone-row-main > i > b { width: var(--h); }
.view-stats .stats-zone-row > strong { flex: none; font-size: var(--fs-title-m); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 내 최고 기록: 카드 전체가 기록 페이지로 */
.view-stats .stats-sec-records { width: 100%; gap: 6px; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: filter var(--motion-press-ms); }
.view-stats .stats-sec-records:active { filter: brightness(.96); }
.view-stats .stats-sec-records .stats-sec-title { font-size: var(--fs-title-xl); font-weight: 800; letter-spacing: -0.02em; }
/* 내 최고 기록: 두 칸 (2026-11-10 구성 시안) */
.view-stats .stats-record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.view-stats .stats-record-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.view-stats .stats-record-k { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.view-stats .stats-record-v { display: flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.view-stats .stats-record-cell > small, .view-stats .stats-record-v > small { color: var(--muted); }
.view-stats .stats-record-cell > small { word-break: keep-all; }
.view-stats .stats-record-cell.is-new .stats-record-v > b { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .view-stats :is(.stats-settle-foldbody, .stats-settle-fold .stats-tile-chev) { transition: none; }
  .view-stats :is(.stats-viz-bars.is-tappable > button > i, .stats-tile-bars > i, .stats-viz-col > i, .stats-zone-row-main > i > b) { transition: none; }
  .view-stats .stats-viz-zonelist-rows.is-settling { animation: none; }
}

/* ── 넓은 화면(768px~, 2026-11-05): 첫 화면은 폰 폭 두 열. 열 하나가 폰과 같은 360~510px이라 카드 비율이 그대로이고,
   한 열로 736px까지 늘어나던 지난 업무 카드·타일이 휑하지 않다. 칸은 위에서 아래로 채우고 카드는 열 사이에서 끊기지 않는다. ── */
@media (min-width: 768px) {
  .view-stats .stats-home > .stats-sections { display: block; column-count: 2; column-gap: 16px; }
  .view-stats .stats-home > .stats-sections > .stats-sec { break-inside: avoid; margin-bottom: 14px; }
}

/* 순위 줄의 이름 칸 (2026-11-05 점검): 76px 칸에서 "232C · 310CD"가 "232C · 3…"로 잘렸다.
   줄들이 한 격자를 나눠 써서 이름 칸은 가장 긴 이름만큼(카드 폭의 45%까지), 막대는 모든 줄에서 같은 자리에서 시작한다. */
@supports (grid-template-columns: subgrid) {
  .view-stats .stats-viz-rows { display: grid; grid-template-columns: fit-content(45%) minmax(40px, 1fr) auto; column-gap: 12px; }
  .view-stats .stats-viz-rows > .stats-viz-duel-row { grid-column: 1 / -1; grid-template-columns: subgrid; }
}
}

/* ── 2026-11-13 회차 블록 (시안 docs/design/mockups/delivery-flow-chart-20261113.html 가): the day as its rounds.
   A block's width is the round's time and its height its 가구/시; a break is empty space with its minutes.
   Colours and the readout are the bars' own: neutral blocks, the picked one in the accent. ── */
.view-stats .stats-rounds { position: relative; height: 84px; box-shadow: inset 0 -1px 0 var(--line); }
.view-stats .stats-round { position: absolute; left: var(--from); bottom: 1px; display: flex; flex-direction: column; gap: 2px; width: var(--w); height: 0; min-width: 0; padding: 8px 4px 0 10px; overflow: hidden; border: 0; border-radius: var(--r-sm) var(--r-sm) 2px 2px; background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); text-align: left; cursor: pointer; transition: height var(--spring-snappy-ms) var(--spring-snappy), background var(--motion-press-ms); }
.view-stats .is-drawn .stats-round { height: var(--h); }
.view-stats .stats-round > b { font: 700 var(--fs-display-s)/1 var(--font-numeric); letter-spacing: -0.022em; font-variant-numeric: tabular-nums; }
.view-stats .stats-round > small { color: var(--muted); font: 500 var(--fs-caption)/1.3 var(--font-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.view-stats .stats-round[aria-pressed="true"] { background: linear-gradient(180deg, var(--gold), var(--gold2)); color: var(--gold-ink); }
.view-stats .stats-round[aria-pressed="true"] > small { color: color-mix(in srgb, var(--gold-ink) 82%, transparent); }
.view-stats .stats-round[data-size="number"] { padding-left: 6px; }
.view-stats .stats-round:is([data-size="number"], [data-size="low"]) > small, .view-stats .stats-round[data-size="bare"] > * { display: none; }
.view-stats .stats-round:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.view-stats .stats-round-rest { position: absolute; left: var(--from); bottom: 8px; width: var(--w); color: var(--muted); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; }
.view-stats .stats-round-ticks { position: relative; height: 16px; margin-top: 6px; color: var(--muted); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.view-stats .stats-round-ticks > span { position: absolute; top: 0; left: var(--from); height: 16px; padding-left: 2px; border-left: 1px solid color-mix(in srgb, var(--muted) 40%, transparent); white-space: nowrap; }
.view-stats .stats-round-ticks > span.is-end { right: 0; left: auto; padding: 0 2px 0 0; border-right: 1px solid color-mix(in srgb, var(--muted) 40%, transparent); border-left: 0; }
@media (prefers-reduced-motion: reduce) {
  .view-stats .stats-round { transition: none; }
}
