@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --ink: #17191F;
  --ink-2: #4E5561;
  --sub: #8A919C;
  --line: #E6E8EC;
  --accent: #3268F0;
  --accent-ink: #1F4FCC;
  --accent-weak: #EAF0FE;
  --good: #11A683;
  --warn: #F2A516;
  --bad: #F0565B;
  --self: #FF6A3D;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 56px; padding: 0 22px; border-radius: 16px; font-size: 17px; font-weight: 650;
  background: var(--accent); color: #fff; transition: background .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:hover { background: var(--accent-ink); }
.btn[disabled] { background: #C9D2E3; color: #fff; cursor: default; transform: none; }
.btn.ghost { background: var(--accent-weak); color: var(--accent-ink); }
.btn.ghost:hover { background: #DCE6FD; }
.btn.plain { background: #EEF0F3; color: var(--ink-2); }
.btn.plain:hover { background: #E3E6EA; }
.btn.small { height: 40px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.wait { background: #E9ECF0; color: var(--ink-2); }
.btn.wait:hover { background: #E9ECF0; }
.btn.danger { background: #FDECEC; color: #C93338; }
.btn.danger:hover { background: #FAD9DA; }

.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.open { background: #E6F7F2; color: #0B8466; }
.chip.closed { background: #EEF0F3; color: var(--sub); }
.chip.done { background: var(--accent-weak); color: var(--accent-ink); }

/* ── 그래프 공통 ── */
.chart { width: 100%; height: auto; display: block; font-family: var(--font); overflow: visible; }
.chart .grid { fill: none; stroke: #E3E6EB; stroke-width: 1.2; }
.chart .grid.outer { stroke: #CDD2DA; }
.chart .tick { fill: var(--sub); font-size: 16px; }
.chart .axis-label { fill: var(--ink); font-weight: 650; }
.chart .axis-val { fill: var(--accent-ink); font-weight: 750; }
.chart .axis-val.is-self { fill: var(--self); }
.chart .person { fill: none; stroke: var(--accent); stroke-opacity: .16; stroke-width: 1.4; }
.chart .norm { fill: none; stroke: #9AA1AC; stroke-width: 2.4; stroke-dasharray: 7 6; }
.chart .mean { fill: var(--accent); fill-opacity: .2; stroke: var(--accent); stroke-width: 3.5; stroke-linejoin: round; }
.chart .mean-dot { fill: var(--accent); }
.chart .self { fill: var(--self); fill-opacity: .14; stroke: var(--self); stroke-width: 3; stroke-linejoin: round; }
.chart .self-dot { fill: var(--self); }
.chart .plot-bg { fill: #FAFBFC; stroke: #DDE1E7; }
.chart .quad-hi { fill: var(--accent); fill-opacity: .045; }
.chart .center-box { fill: var(--warn); fill-opacity: .1; stroke: var(--warn); stroke-opacity: .5; stroke-dasharray: 5 5; }
.chart .corner { fill: #A0A6B0; font-size: 19px; font-weight: 650; }
.chart .cut { stroke: #B9C0CA; stroke-width: 1.6; stroke-dasharray: 6 6; }
.chart .axis-title { fill: var(--ink-2); font-size: 18px; font-weight: 650; }
.chart .pt { stroke: #fff; stroke-width: 2.5; fill-opacity: .92; }
.chart .pt.pop { animation: pop .9s cubic-bezier(.2, 1.6, .4, 1) both; transform-box: fill-box; transform-origin: center; }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.5); } 100% { transform: scale(1); } }
.chart .avg-mark line { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.chart .self-ring { fill: none; stroke: var(--self); stroke-width: 3; }
.chart .self-pt { fill: var(--self); }
.chart .zone { fill-opacity: .07; }
.chart .zone-label { font-size: 17px; font-weight: 700; }
.chart .baseline { stroke: #B9C0CA; stroke-width: 1.5; }
.chart .mean-line { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 4; }
.chart .mean-text { fill: var(--ink); font-size: 16px; font-weight: 700; }
.chart .self-text { fill: var(--self); font-size: 16px; font-weight: 750; }
.chart .bars-title { fill: var(--ink-2); font-size: 18px; font-weight: 700; }
.chart .bar-label { fill: var(--ink); font-size: 18px; font-weight: 650; }
.chart .bar-track { fill: #EEF0F3; }
.chart .bar-fill { fill: var(--bad); fill-opacity: .8; }
.chart .bar-val { fill: var(--ink); font-size: 18px; font-weight: 750; }
.chart .center-label { fill: #C98A0A; }
/* 휴대폰 결과 화면: 그래프가 작게 축소되므로 글자를 키움 */
.chart.compact .tick { font-size: 24px; }
.chart.compact .corner { font-size: 26px; }
.chart.compact .axis-title { font-size: 26px; }
.chart.compact .zone-label { font-size: 23px; }
.chart.compact .mean-text, .chart.compact .self-text { font-size: 26px; }
.chart.compact .bars-title, .chart.compact .bar-label, .chart.compact .bar-val { font-size: 26px; }
.chart.compact .pt { stroke-width: 2; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend span { display: inline-flex; align-items: center; }
.legend .lg-icon { margin-right: 6px; }
.legend i.line { width: 20px; height: 0; border-radius: 0; border-top: 3px solid; }
.legend i.dash { width: 20px; height: 0; border-radius: 0; border-top: 3px dashed #9AA1AC; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  background: rgba(23, 25, 31, .92); color: #fff; padding: 12px 18px; border-radius: 14px;
  font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
