/* =====================================================================
   progress.css — «Прогресс» and «Админ» screens (calm editorial).
   Tokens only; both themes via the token block in base.css.
   ===================================================================== */

@keyframes grow { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes reveal-c { from { clip-path: inset(-10px 100% -10px -10px); } to { clip-path: inset(-10px -10px -10px -10px); } }

.page section { min-width: 0; }
.page .sub { margin-top: var(--s-3); }

/* ---------- level path ---------- */
.path { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin-top: var(--s-5); }
.path .ln, .path .fill { position: absolute; left: 12.5%; top: 11px; }
.path .ln { right: 12.5%; height: 1px; background: var(--line2); }
.path .fill { height: 3px; margin-top: -1px; border-radius: 2px; background: var(--accent); max-width: 75%; animation: grow 1.1s cubic-bezier(.2, .8, .3, 1) both; transform-origin: left; }
.nd { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nd i { width: 23px; height: 23px; border-radius: 50%; border: 1.5px solid var(--line2); background: var(--bg); display: block; }
.nd.done i { background: var(--accent); border-color: var(--accent); }
.nd.here i { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), inset 0 0 0 4px var(--accent); }
.nd b { font-family: var(--font-head); font-weight: 500; font-size: var(--t-xl); line-height: 1; }
.nd small { font-size: var(--t-xs); color: var(--muted); letter-spacing: .06em; white-space: nowrap; }
.nd.here small { color: var(--text); font-weight: 600; }

/* ---------- deck ---------- */
.deck-total { font-size: var(--t-3xl); line-height: 1; margin: var(--s-4) 0 var(--s-3); }
.deck-total small { font-size: var(--t-lg); font-style: italic; color: var(--muted); margin-left: 8px; }
.stack { display: flex; height: 14px; border: 1px solid var(--text); border-radius: 2px; overflow: hidden; }
.stack i { display: block; height: 100%; animation: grow 1s cubic-bezier(.2, .8, .3, 1) both; transform-origin: left; }
.stack i + i { border-left: 1px solid var(--bg); }
.sg-1 { background: var(--accent); }
.sg-3 { background: var(--warn-soft); background-image: repeating-linear-gradient(135deg, transparent 0 3px, color-mix(in srgb, var(--warn) 60%, transparent) 3px 4px); }
.sg-4 { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--line2) 4px 5px); }
.dk { list-style: none; padding: 0; margin-top: var(--s-3); }
.dk li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); min-height: 44px; }
.dk li i { width: 14px; height: 14px; border: 1px solid var(--text); border-radius: 2px; flex: none; }
.dk .nm { font-family: var(--font-head); font-size: var(--t-md); overflow-wrap: anywhere; }
.dk .ld { flex: 1; border-bottom: 1px dotted var(--line2); transform: translateY(2px); min-width: 12px; }
.dk b { font-family: var(--font-head); font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }
.dk em { font-style: normal; font-size: var(--t-xs); color: var(--muted); width: 42px; text-align: right; }

/* ---------- charts ---------- */
.headline { display: flex; align-items: baseline; justify-content: space-between; margin: var(--s-4) 0 var(--s-2); gap: var(--s-3); }
.headline .big { font-family: var(--font-head); font-size: var(--t-2xl); font-variant-numeric: lining-nums; line-height: 1.1; }
.headline .delta { font-size: var(--t-sm); color: var(--ok); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.headline .delta.up { color: var(--warn); }
.chart { width: 100%; height: auto; display: block; overflow: visible; animation: reveal-c 1.2s cubic-bezier(.4, .1, .2, 1) .1s both; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.chart .base { stroke: var(--line2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .ar { fill: var(--accent-soft); opacity: .8; }
.chart .dt { fill: var(--bg); stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .dt.last { fill: var(--accent); }
.chart-cap { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--muted); margin-top: 6px; letter-spacing: .04em; }

/* ---------- rules ---------- */
.rule-row { display: flex; align-items: center; gap: var(--s-3); padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 56px; }
.rule-row .st { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; border: 1.5px solid var(--line2); color: var(--muted); }
.rule-row.ok .st { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rule-row.now .st, .rule-row.weak .st { border-color: var(--warn); color: var(--warn); }
.rule-row .st .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.rule-row .tx { flex: 1; min-width: 0; }
.rule-row .tx b { font-family: var(--font-head); font-weight: 500; font-size: var(--t-md); display: block; line-height: 1.3; overflow-wrap: anywhere; }
.rule-row .tx small { font-size: var(--t-xs); color: var(--muted); letter-spacing: .04em; }
.rule-row .rs { font-size: var(--t-sm); color: var(--muted); text-align: right; flex: none; max-width: 40%; }
.rule-row .rs small { display: block; font-size: var(--t-xs); margin-top: 2px; }
.rule-row.ok .rs { color: var(--ok); }
.rule-row.now .rs, .rule-row.weak .rs { color: var(--warn); font-weight: 600; }
.rule-row .mini { display: block; width: 72px; height: 3px; background: var(--tick-off); border-radius: 2px; margin-top: 6px; margin-left: auto; overflow: hidden; }
.rule-row .mini i { display: block; height: 100%; background: var(--warn); }
.more > summary { cursor: pointer; display: flex; align-items: center; min-height: 48px; color: var(--accent); font-weight: 600; font-size: var(--t-sm); letter-spacing: .02em; border-bottom: 1px solid var(--line); }
.more[open] > summary { color: var(--muted); }

/* ---------- mistakes · sessions ---------- */
.mist .row { min-height: 44px; padding: 10px 0; }
.mist .row .nm { font-size: var(--t-md); overflow-wrap: anywhere; min-width: 0; }
.tbl { width: 100%; border-collapse: collapse; margin-top: var(--s-1); font-variant-numeric: lining-nums tabular-nums; }
.tbl th, .tbl td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; font-family: var(--font-head); font-size: var(--t-md); font-weight: 400; }
.tbl thead th { font-family: var(--font); font-size: var(--t-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; border-bottom-color: var(--line2); padding-top: var(--s-2); }
.tbl th:first-child, .tbl td:first-child { text-align: left; padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl tbody th { font-style: italic; }
.tbl td.pl { color: var(--accent); }
.tbl td:nth-child(2), .tbl td:nth-child(3) { color: var(--muted); }

/* ---------- forecast (marginalia) ---------- */
.note .fc { margin-top: var(--s-4); }
.heat { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; margin-top: var(--s-3); }
.heat i { aspect-ratio: 1; border-radius: 2px; background: var(--tick-off); opacity: .55; }
.heat i.l1 { background: color-mix(in srgb, var(--accent) 28%, var(--surface2)); opacity: 1; }
.heat i.l2 { background: color-mix(in srgb, var(--accent) 52%, var(--surface2)); opacity: 1; }
.heat i.l3 { background: color-mix(in srgb, var(--accent) 76%, var(--surface2)); opacity: 1; }
.heat i.l4 { background: var(--accent); opacity: 1; }
.heat i.rest { background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn); opacity: 1; }
.heat i.today { box-shadow: 0 0 0 1.5px var(--text); opacity: 1; }
.heat-cap { display: flex; justify-content: space-between; align-items: center; font-size: var(--t-xs); color: var(--muted); margin-top: var(--s-2); }
.heat-cap .sc { display: inline-flex; gap: 3px; align-items: center; }
.heat-cap .sc i { width: 10px; height: 10px; border-radius: 2px; display: block; background: var(--tick-off); }
.heat-cap .sc i.l1 { background: color-mix(in srgb, var(--accent) 28%, var(--surface2)); }
.heat-cap .sc i.l2 { background: color-mix(in srgb, var(--accent) 52%, var(--surface2)); }
.heat-cap .sc i.l3 { background: color-mix(in srgb, var(--accent) 76%, var(--surface2)); }
.heat-cap .sc i.l4 { background: var(--accent); }
.note .week { margin-top: var(--s-3); }

/* ---------- admin ---------- */
.admin-pane { display: flex; flex-direction: column; gap: var(--s-6); min-width: 0; }
.admin-list { display: flex; flex-direction: column; gap: var(--s-4); }
.user { gap: var(--s-4); }
.user.blocked { border-style: dashed; background: var(--surface2); }
.user-head { display: flex; flex-direction: column; gap: var(--s-2); }
.user-head h3 { font-size: var(--t-xl); line-height: 1.1; overflow-wrap: anywhere; }
.user .row { min-height: 40px; padding: 6px 0; }
.user .row .nm { font-size: var(--t-md); }
.user .row .vl { font-size: var(--t-md); }
.user .row .vl small { margin-right: 4px; }
.user .rows .row:last-child { border-bottom: 0; }
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field .inp { flex: 1; min-width: 0; width: auto; }
.acts { flex-wrap: wrap; }
.acts .btn { flex: 1 1 0; min-width: max-content; padding: 0 var(--s-3); }
.pw-out { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3) var(--s-4); background: var(--warn-soft); border: 1px dashed var(--warn); border-radius: var(--r); }
.pw-out .row-flex { justify-content: space-between; }
.code { font-family: var(--mono); font-size: var(--t-lg); letter-spacing: .08em; overflow-wrap: anywhere; user-select: all; }
.new-invite { display: flex; flex-direction: column; gap: var(--s-3); }
.new-invite .btn { align-self: stretch; margin-top: var(--s-2); }
.code-slip { background: var(--slip); border: 1px solid var(--slip-edge); border-radius: var(--r); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: var(--s-2);
  box-shadow: 0 var(--emboss-y) 0 var(--emboss) inset, 0 6px 14px -10px var(--shadow); }
.code-line { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.code-line .code { font-size: 1.375rem; letter-spacing: .12em; }
.code-slip.dead { background: transparent; box-shadow: none; border-style: dashed; }
.code-slip.dead .code { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

/* usage chart: hairline axes, series colours --c0…--c5 */
.uchart { position: relative; margin-top: var(--s-3); padding-left: 30px; }
.ymax { position: absolute; left: 0; top: -6px; font-size: var(--t-xs); color: var(--muted); }
.ubars { display: flex; gap: 1px; align-items: flex-end; height: 160px; border-left: 1px solid var(--line2); border-bottom: 1px solid var(--line2);
  background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 50% repeat-y; }
.ubar { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.ucol { width: 100%; min-height: 2px; display: flex; flex-direction: column-reverse; border-radius: 1px 1px 0 0; overflow: hidden; transform-origin: bottom; animation: grow-y .8s cubic-bezier(.2, .8, .3, 1) both; }
.ucol i { display: block; min-height: 1px; }
.uchart + .chart-cap { padding-left: 30px; }
.trow { display: grid; grid-template-columns: minmax(5rem, 8.5rem) 1fr 44px; gap: var(--s-3); align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); }
.trow .nm { font-family: var(--font-head); overflow-wrap: anywhere; }
.trow b { font-family: var(--font-head); font-weight: 500; text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.trow .bar { height: 8px; border-radius: 1px; }

@media (min-width: 1024px) {
  .page.admin { max-width: 1040px; }
  .admin-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); align-items: start; }
  .new-invite .btn { align-self: flex-start; min-width: 220px; }
  .rule-row .rs { max-width: none; }
  .ubars { height: 200px; }
}
