/* 그래프 계열색: 선 색. 면은 같은 색을 반투명으로 (--fill-op) */
:root {
  --s-muscle: #86a3d8; --s-fat: #e39f7d; --s-other: #86bfa1;
  --fill-op: .38;
  --l-weight: #a08b74; --l-pbf: #a99bd6;
  --axis: #e3d6c1; --gridline: #f1e9dc;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --s-muscle: #93aee0; --s-fat: #e7a888; --s-other: #93c7ab;
    --fill-op: .28;
    --l-weight: #c2ae96; --l-pbf: #b6aae6;
    --axis: #4b4139; --gridline: #3c342e;
  }
}
:root[data-theme="dark"] {
  --s-muscle: #93aee0; --s-fat: #e7a888; --s-other: #93c7ab;
  --fill-op: .28;
  --l-weight: #c2ae96; --l-pbf: #b6aae6;
  --axis: #4b4139; --gridline: #3c342e;
}

main { max-width: 1100px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 64px) 16px 40px; }
header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
h1 { margin: 0; font-size: 26px; font-weight: 900; }
h2 { margin: 0; font-size: 18px; font-weight: 800; }
.dim { color: var(--dim); font-size: 13px; margin: 2px 0 0; }
.bar { display: flex; align-items: center; gap: 12px; }
.pill { background: var(--t1); padding: 8px 18px; border-radius: 999px; font-weight: 800; box-shadow: 0 3px 0 var(--shadow); }
.pill:disabled { opacity: .5; cursor: wait; }

.filters { display: inline-flex; margin: 16px 0 4px; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--panel); }
.filters button { color: var(--dim); font-size: 13px; padding: 6px 14px; }
.filters button[aria-pressed="true"] { background: var(--t1); color: var(--fg); font-weight: 700; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-top: 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 4px; font-size: 13px; }
.legend span, .legend button { display: inline-flex; align-items: center; gap: 6px; }
.legend button { padding: 4px 10px; margin: -4px -4px; border-radius: 999px; }
.legend button:hover { background: var(--hover); }
.legend button[aria-pressed="false"] { color: var(--dim); text-decoration: line-through; opacity: .55; }
.legend button[aria-pressed="false"] i { background: transparent; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i, .tip i { box-shadow: inset 0 0 0 1.5px var(--c); background: color-mix(in srgb, var(--c) calc(var(--fill-op) * 100%), transparent); }

.chart { position: relative; width: 100%; height: 320px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; touch-action: pan-y; }
.chart .grid line { stroke: var(--gridline); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart text { fill: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart text.label { fill: var(--fg); font-size: 12px; font-weight: 700; }
.chart .band { stroke: none; fill-opacity: var(--fill-op); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .edge { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { stroke: var(--panel); stroke-width: 2; }
.empty { display: grid; place-items: center; height: 100%; color: var(--dim); }

.tip {
  position: fixed; z-index: 8; pointer-events: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 6px 18px var(--shadow); padding: 8px 12px; font-size: 13px; line-height: 1.5;
  font-variant-numeric: tabular-nums; min-width: 160px;
}
.tip b { display: block; margin-bottom: 2px; }
.tip .row { display: flex; align-items: center; gap: 6px; }
.tip .row span:last-child { margin-left: auto; padding-left: 12px; font-weight: 700; }
.tip i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.table-wrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
th, td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); }
thead th { color: var(--dim); font-weight: 700; }

#login input {
  width: 100%; margin: 0 0 10px; padding: 12px 14px; font: inherit; font-size: 16px;
  color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
#login .modal-actions { margin-top: 6px; }
