/* Framsteg (framsteg-view.js): how it has gone over time, a card for each area.
   The page is ink on stone like the rest of the app. Gold is what has been done
   or reached: a ticked day, a night that met its goal, the way toward the goal
   weight. Nothing here is blue (blue is "do this now"), nothing glows and nothing moves. */

/* The way here, in the head beside the statue. */
.progress-link[aria-current="page"] { color: var(--text-primary); }

.fs-period { margin: 0 0 var(--space-5); padding: 0; border: 0; min-width: 0; }
.fs-period .segmented { float: none; display: flex; width: 100%; }
.fs-period .segmented label { flex: 1 1 0; justify-content: center; min-height: 44px; text-align: center; }

/* What went best: a line each, a gold mark before it. */
.fs-top { margin: 0 0 var(--space-5); }
.fs-top ul { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.fs-top li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: var(--space-3); align-items: baseline; font-size: var(--text-base); font-weight: 600; line-height: 1.35; }
.fs-top li::before { content: ""; width: 8px; height: 8px; background: var(--built); transform: translateY(-1px) rotate(45deg); }
.fs-intro { margin: 0 0 var(--space-5); color: var(--text-secondary); line-height: 1.5; }

/* A card: the area's name and its one figure, a line under it, the chart, and the small figures. */
.fs-head { align-items: baseline; margin-bottom: var(--space-1); }
.fs-figure { margin: 0; text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fs-figure strong { font-size: var(--text-xl); font-weight: 700; letter-spacing: 0; }
.fs-figure small { font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); }
.fs-line { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.45; }
.fs-plot { margin-top: var(--space-4); }
.fs-key { margin: var(--space-2) 0 0; font-size: var(--text-xs); }
.fs-sub { margin: var(--space-5) 0 var(--space-1); font-family: var(--font); font-size: var(--text-sm); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-secondary); }

.fs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: var(--space-3) var(--space-4); margin: var(--space-4) 0 0; }
.fs-facts div { min-width: 0; }
.fs-facts dt { font-size: var(--text-xs); color: var(--text-secondary); }
.fs-facts dd { margin: 2px 0 0; font-size: var(--text-base); font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fs-facts dd small { display: block; margin-top: 2px; font-size: var(--text-xs); font-weight: 500; color: var(--text-secondary); }

/* The charts' own parts (shared/chart.js: trend, bars, spark). */
.chart-raw { fill: var(--text-secondary); stroke: none; opacity: 0.38; }
.chart-goal { stroke: var(--built-text); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-goal-text { fill: var(--built-text); font-weight: 600; }
.chart-bar { fill: var(--text-primary); stroke: none; }
.chart-bar.none { fill: var(--border-strong); }
.chart-bar.open { opacity: 0.35; }
.chart-bar.met { fill: var(--built); }
.chart-floor { stroke: var(--border-strong); }
.chart-spark { flex: none; width: 72px; height: 24px; overflow: visible; }
.chart-spark .chart-line { stroke-width: 1.75; }

/* The way from the weight at the start to the goal weight. */
.fs-way { margin-top: var(--space-4); }
.fs-way .level-bar { margin-top: 0; border-radius: 999px; }
.fs-way-ends, .fs-days-ends { display: flex; justify-content: space-between; gap: var(--space-3); margin: var(--space-1) 0 0; font-size: var(--text-xs); color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* A cell a day (or a week): gold for done, an empty one for missed, a faint one for a day that did not count. */
.fs-cells { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; width: 100%; }
.fs-cells i { height: 8px; border-radius: 2px; background: var(--surface-secondary); }
.fs-cells i.done { background: var(--built); }
.fs-cells i.part { background: color-mix(in srgb, var(--built) 45%, var(--surface-secondary)); }
.fs-cells i.na { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.fs-cells.many { gap: 1px; }
.fs-days { margin-top: var(--space-4); }
.fs-days .fs-cells i { height: 22px; border-radius: 3px; }

/* The exercises done most: the name, where it went, and its curve. */
.fs-lifts, .fs-habits { display: grid; margin: 0; padding: 0; list-style: none; }
.fs-lifts li + li { border-top: 1px solid var(--border); }
.fs-lift { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 56px; padding: var(--space-2) 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--text-primary); font: inherit; text-align: start; }
.fs-lift-name { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fs-lift-name b { font-weight: 600; overflow-wrap: anywhere; }
.fs-lift-name small { font-size: var(--text-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.fs-pb { font-size: var(--text-sm); font-style: normal; font-weight: 600; color: var(--built-text); }
.fs-go { flex: none; font-size: var(--text-lg); line-height: 1; color: var(--text-secondary); }
html[dir="rtl"] .fs-go { transform: scaleX(-1); }

.fs-habits { gap: var(--space-4); margin-top: var(--space-4); }
.fs-habit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); align-items: baseline; }
.fs-habit-name { font-weight: 600; overflow-wrap: anywhere; }
.fs-habit-n { font-size: var(--text-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fs-habit .fs-cells { grid-column: 1 / -1; }
.fs-more { margin-top: var(--space-3); padding-inline: 0; min-height: 44px; color: var(--accent-strong); font-weight: 600; }

/* A row that leads somewhere: the statue, and what there is too little of for a card. */
.fs-row { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-3) 0; color: var(--text-primary); text-decoration: none; }
.fs-row > span:first-child { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fs-row b { font-weight: 600; }
.fs-row small { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.4; }
.fs-row .text-button { flex: none; min-height: 44px; font-size: var(--text-sm); padding-inline: 0; color: var(--accent-strong); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; }
.fs-statue { margin: var(--space-2) 0 var(--space-5); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.fs-missing { margin: var(--space-5) 0; }
.fs-missing h2 { margin: 0 0 var(--space-1); font-family: var(--font); font-size: var(--text-sm); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-secondary); }
.fs-missing ul { margin: 0; padding: 0; list-style: none; }
.fs-missing li + li { border-top: 1px solid var(--border); }

@media (max-width: 359px) {
  .fs-row { flex-wrap: wrap; }
}

/* Written right to left (Persian): time still runs from the oldest day at the left, in the
   charts and in the rows of cells alike, so the page does not turn half of it around. The
   charts' texts are placed from the left as they are drawn. The way to the goal weight is
   not time: it fills from the side its start stands on. */
html[dir="rtl"] .chart, html[dir="rtl"] .chart-spark, html[dir="rtl"] .fs-cells, html[dir="rtl"] .fs-days-ends { direction: ltr; }
html[dir="rtl"] .fs-way .level-bar b { inset: 0 0 0 auto; }
