/* Training load sheet and gauge (load-ui.js). */

/* ---------- dial / gauge ---------- */
.tl-gauge { position: relative; width: 100%; max-width: 210px; margin: 2px auto 0; }
.tl-dial { width: 100%; display: block; overflow: visible; }
.tl-dial line { stroke-width: 3.6; stroke-linecap: round; }
.tl-dial line.off { stroke: var(--n-hair); }
.tl-d-halo { fill: none; stroke: var(--n-badge); stroke-width: 9; stroke-linecap: round; }
.tl-d-guide { fill: none; stroke: #e6e8eb; stroke-width: 5; stroke-linecap: round; }
.tl-d-burn { fill: none; stroke-width: 9; stroke-linecap: round; }
.tl-d-burn.act { filter: drop-shadow(0 0 3px rgba(249, 115, 22, 0.5)); }
:root[data-theme="dark"] .tl-d-burn.rest { opacity: 0.7; }
.tl-d-band { fill: none; stroke: var(--acc-mint); stroke-width: 5; stroke-linecap: round; }
.tl-d-face { fill: var(--panel); filter: drop-shadow(0 6px 14px rgba(var(--n-ink-rgb), 0.07)); }
.tl-d-ring { fill: var(--panel); filter: drop-shadow(0 2px 5px rgba(var(--n-ink-rgb), 0.22)); }
:root[data-theme="dark"] .tl-dial line.off, :root[data-theme="dark"] .tl-d-guide { stroke: var(--d-line); }
:root[data-theme="dark"] .tl-d-halo { stroke: var(--d-tile); }
.tl-g-val { position: absolute; left: 0; right: 0; top: 56%; transform: translateY(-50%); text-align: center; font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.tl-g-lo, .tl-g-hi { position: absolute; bottom: -2px; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-g-lo { left: 20%; }
.tl-g-hi { right: 17%; }
.tl-optimal { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 8px; }
.tl-optimal b { color: var(--text); opacity: 0.75; font-variant-numeric: tabular-nums; }
.tl-optimal i { width: 12px; height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 22%, transparent); border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); box-sizing: border-box; }

/* Home: Cardio and Muscular as two cards side by side. */
.hm-pair.hm-pair-1 { grid-template-columns: 1fr; }
.hm-ld-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hm-ld { text-align: center; min-width: 0; padding: 14px 12px 14px !important; margin: 0 !important; display: block; width: 100%; font: inherit; color: inherit; }
.hm-ld .tl-g-val { font-size: 32px; }
.hm-ld-k { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--muted); font-size: 15px; }
.hm-ld-s { display: block; text-align: left; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 2px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-ld .tl-optimal { font-size: 12px; }
@media (max-width: 360px) { .hm-ld-s { font-size: 17px; } }

/* ---------- sheet ---------- */
.tl-head { position: relative; text-align: center; margin: 0 0 6px; }
.tl-head .vs-title { margin: 0; }
.tl-info-btn, .tl-nav { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--panel); box-shadow: var(--shadow); display: inline-grid; place-items: center; cursor: pointer; color: var(--text); flex-shrink: 0; }
.tl-info-btn { position: absolute; top: 0; right: 0; }
.tl-info-btn.on { background: var(--text); color: var(--panel); }
.tl-info-btn svg, .tl-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tl-nav:disabled { opacity: 0.35; cursor: default; }
.tl-info { background: var(--panel); border-radius: 18px; padding: 12px 14px; font-size: 14px; line-height: 1.5; margin: 8px 0; box-shadow: var(--shadow); }
.tl-loading, .tl-empty { padding: 28px 4px; text-align: center; line-height: 1.5; }

.tl-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 14px 2px 12px; }
.tl-big { font-size: 46px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tl-top-r { text-align: right; }
.tl-status { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }

.tl-toggle { display: inline-flex; gap: 8px; margin: 0 0 10px; }
.tl-toggle button { border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.tl-toggle button.on { background: var(--text); color: var(--panel); border-color: var(--text); }

.tl-chart { position: relative; padding-right: 34px; margin: 6px 0 4px; user-select: none; -webkit-user-select: none; }
.tl-plot { position: relative; height: 200px; touch-action: none; overscroll-behavior: contain; cursor: crosshair; }
.tl-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tl-band { fill: color-mix(in srgb, var(--accent) 18%, transparent); }
.tl-lines line { stroke: var(--muted); stroke-opacity: 0.55; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tl-lines.many line { stroke-opacity: 1; stroke-width: 2.4; }
.tl-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--panel); border: 2.5px solid var(--c); box-sizing: border-box; pointer-events: none; }
.tl-dot.sel { width: 16px; height: 16px; margin: -8px 0 0 -8px; background: var(--c); border: 3px solid var(--panel); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 28%, transparent); z-index: 1; }
.tl-cursor { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--muted); opacity: 0.5; pointer-events: none; }
.tl-y { position: absolute; right: -34px; width: 26px; text-align: right; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.tl-ybar { position: absolute; right: -6px; width: 4px; border-radius: 2px; background: var(--accent); }
.tl-x { position: relative; height: 22px; margin-top: 6px; border-top: 1px solid var(--border); }
.tl-x span { position: absolute; top: 5px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-x span.start { transform: none; }
.tl-x span.end { transform: translateX(-100%); color: var(--text); font-weight: 700; }

.tl-ranges { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; }
.tl-seg { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel-2); border-radius: 999px; padding: 3px; }
.tl-seg button { border: 0; background: none; font: inherit; font-weight: 700; font-size: 14px; color: var(--muted); padding: 7px 0; border-radius: 999px; cursor: pointer; }
.tl-seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

.tl-coach { background: var(--panel); border-radius: 20px; padding: 14px 16px; margin: 14px 0 4px; box-shadow: var(--shadow); }
.tl-coach-title { font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.tl-coach p { margin: 6px 0 0; line-height: 1.5; }

.tl-sec { font-size: 20px; font-weight: 700; margin: 24px 2px 10px; }
.tl-table, .tl-bars, .tl-list { background: var(--panel); border-radius: 20px; box-shadow: var(--shadow); padding: 4px 14px; }
.tl-tr { display: grid; grid-template-columns: minmax(124px, 1.3fr) 38px 1fr 46px; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.tl-tr:last-child { border-bottom: 0; }
.tl-th { font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 0 6px; }
.tl-th span:last-child, .tl-pct { text-align: right; }
.tl-st { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.tl-st i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tl-tr b { font-variant-numeric: tabular-nums; }
.tl-pct { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.tl-bar { height: 8px; border-radius: 5px; background: var(--panel-2); overflow: hidden; }
.tl-bar i { display: block; height: 100%; border-radius: 5px; }
.tl-brow { display: grid; grid-template-columns: minmax(116px, 1fr) 1.2fr 44px; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.tl-brow:last-child { border-bottom: 0; }
.tl-bl { font-weight: 600; display: flex; flex-direction: column; min-width: 0; }
.tl-bl small { font-size: 12px; color: var(--muted); font-weight: 500; }
.tl-brow b { text-align: right; font-variant-numeric: tabular-nums; }
.tl-li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.tl-li:last-child { border-bottom: 0; }
.tl-li > div { display: flex; flex-direction: column; min-width: 0; }
.tl-li > div b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-li-v { font-size: 18px; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.tl-li-v small { font-size: 11px; color: var(--muted); font-weight: 600; }
.tl-note { margin: 6px 2px 0; }
.tl-tip { background: var(--panel-2); border-radius: 16px; padding: 12px 14px; margin-top: 14px; line-height: 1.5; }
.tl-foot { display: flex; justify-content: space-between; gap: 10px; margin: 22px 2px 6px; }
/* Scrubbing the chart shouldn't scroll the page. */
.tl-sheet [data-tl-chart] { touch-action: none; overscroll-behavior: contain; }
