/* Shared HomeFit styles on top of the Syncfusion theme. */
html, body { margin: 0; height: 100%; font-family: var(--hf-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); }

.hf-shell { display: flex; flex-direction: column; min-height: 100vh; }
.hf-appbar .hf-title { font-size: 1.15rem; font-weight: 600; margin-left: .5rem; }
.hf-body { flex: 1; position: relative; }
.hf-content { padding: 16px; max-width: 1100px; margin: 0 auto; box-sizing: border-box; }

.hf-nav { list-style: none; margin: 0; padding: 8px 0; }
.hf-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: inherit; text-decoration: none; }
.hf-nav a.active { font-weight: 600; background: rgba(0, 0, 0, .06); }
.hf-nav a:hover { background: rgba(0, 0, 0, .04); }

.hf-page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.hf-page-header h1 { font-size: 1.6rem; margin: 0; }
.hf-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hf-stack { display: flex; flex-direction: column; gap: 12px; }
.hf-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.hf-row > * { flex: 1 1 160px; min-width: 0; }
.hf-muted { opacity: .7; font-size: .9rem; }
.hf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.hf-card .e-card-content { padding-top: 0; }
.hf-next-block { font-weight: 600; }

.hf-block { border: 1px solid rgba(0, 0, 0, .12); border-radius: 8px; padding: 12px; margin-bottom: 16px; }
.hf-block-header { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.hf-entry { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 0; border-top: 1px dashed rgba(0, 0, 0, .12); }
.hf-entry:first-of-type { border-top: none; }

.hf-big-button { min-width: 220px; font-size: 1.2rem; padding: 14px 24px; }
.hf-touch { min-width: 44px; min-height: 44px; }
.hf-adjust { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hf-ellipsis { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-start-bar { position: sticky; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; background: rgb(var(--color-sf-surface, 255, 255, 255)); }
.hf-run-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; }

/* Session runner: the shell is exactly one screen high, so the runner fits without scrolling. */
.hf-shell:has(.hf-run) { height: calc(100dvh - env(safe-area-inset-top, 0px)); min-height: 0; }
.hf-shell:has(.hf-run) .hf-body,
.hf-shell:has(.hf-run) .e-main-content,
.hf-shell:has(.hf-run) .hf-content { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hf-shell:has(.hf-run) .hf-content { width: 100%; }
.hf-run { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.hf-run > * { flex: none; max-width: 100%; }
.hf-run-header { width: 100%; display: flex; align-items: center; gap: 8px; }
.hf-run-title { flex: 1; min-width: 0; text-align: left; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-run .hf-current-exercise { font-size: 1.6rem; font-weight: 700; line-height: 1.2; margin: 0; }
.hf-run .hf-target { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.hf-run .hf-reps { min-width: 2.5ch; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hf-run .hf-countdown { min-width: 2ch; font-size: 2.4rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hf-run-footer { width: 100%; display: flex; align-items: center; gap: 8px; }
.hf-run-footer > div { flex: 1; min-width: 0; text-align: left; }

.hf-timebar {
    --hf-bar: var(--color-sf-primary, 103, 80, 164);
    position: relative; width: 100%; max-width: 520px; height: 3.25rem; border-radius: 8px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; background: rgba(var(--hf-bar), .12);
}
.hf-timebar-rest { --hf-bar: var(--color-sf-outline, 121, 116, 126); }
.hf-timebar-fill { position: absolute; inset: 0 auto 0 0; background: rgba(var(--hf-bar), .4); transition: width .25s linear; }
.hf-timebar-text { position: relative; font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.hf-sheet.e-dialog { max-width: 600px; border-radius: 16px 16px 0 0; }

@media (max-width: 600px) {
    .hf-content { padding: 12px; }
}

/* Exercise figures (figures/figure.js): colours follow the Syncfusion theme. */
.hf-figure {
    --hf-fig: rgb(var(--color-sf-primary, 103, 80, 164));
    --hf-fig-far: rgba(var(--color-sf-primary, 103, 80, 164), .45);
    --hf-fig-ground: rgb(var(--color-sf-outline-variant, 196, 199, 197));
    --hf-fig-shadow: rgba(0, 0, 0, .15);
    --hf-fig-prop: rgb(var(--color-sf-outline, 121, 116, 126));
    width: 100%;
}
.hf-figure canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; }
/* Takes the height left in a column; the 4:3 drawing is scaled to fit. */
.hf-figure-fill { flex: 1 1 0; min-height: 80px; position: relative; }
.hf-figure-fill > canvas { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; object-fit: contain; }
.hf-figure-fill > .hf-figure-strip { position: absolute; inset: 0; overflow: auto; }
.hf-figure-small { width: 140px; flex: 0 0 140px; }
.hf-figure-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px; }
.hf-variant { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.hf-variant > div { min-width: 0; }
