/* Plan d'entraînement - styles. Mobile first, grid for the week on wide screens. */
:root {
  --bg: #f5f6f8;
  --surface: #fff;
  --text: #1c2430;
  --muted: #5a6575;
  --border: #c9d0da;
  --primary: #0b5fb0;
  --primary-text: #fff;
  --danger: #b3261e;
  --warn-bg: #fff4d6;
  --info-bg: #e3eefb;
  --err-bg: #fde7e5;
  --focus: #ff9d00;
  --chart-density: #6a1b9a; /* density line of the chart tab (distinct from km blue and load orange) */
  --radius: 6px;
  /* Day-card headers: white text >= 5.1:1 on every point of each gradient (checked with contrastRatio) */
  --day-head-from: #00798a;
  --day-head-to: #0b5fb0;
  --day-head-today-from: #08306b;
  --day-head-today-to: #0b5394;
  --day-head-outside-from: #5a6575;
  --day-head-outside-to: #4a5565;
  --day-head-text: #fff;
  --day-head-badge-bg: #fff;
  --day-head-badge-text: #073b72;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

h1 { font-size: 1.3rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
h3 { font-size: 1rem; margin: 0; }
h4 { font-size: .95rem; margin: 0 0 .25rem; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem; z-index: 100; }
.skip-link:focus { left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header and tabs */
.app-header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); }
/* Runner selector (right side of the header) */
.runner-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-left: auto; }
.runner-field { display: flex; align-items: center; gap: .4rem; }
.runner-field select { max-width: 14rem; }
#tabs { display: flex; flex-wrap: wrap; gap: .25rem; }
.tab { font: inherit; background: none; border: 0; border-bottom: 3px solid transparent; padding: .5rem .8rem; cursor: pointer; color: var(--text); }
.tab[aria-current="page"] { border-bottom-color: var(--primary); font-weight: 600; }

/* Accounts and roles (see js/roleGate.js): account bar, entry screens, temporary password, accounts tab */
.runner-bar:empty { display: none; }
.account-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.account-bar:empty { display: none; }
.runner-bar + .account-bar { margin-left: 0; }
.runner-bar:empty + .account-bar { margin-left: auto; }
.account-name { font-weight: 600; }
.auth-screen #tabs, .auth-screen #runner-bar, .auth-screen #account-bar { display: none; }
.auth-card { max-width: 30rem; margin: 2rem auto; }
.auth-card .dialog-actions { justify-content: flex-start; }
.link-button { font: inherit; background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; }
.strength { margin: .1rem 0 .6rem; font-size: .85rem; color: var(--muted); }
.strength[data-score="0"], .strength[data-score="1"] { color: var(--danger); }
.secret-dialog input[readonly] { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; letter-spacing: .05em; }
.account-lines { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: 0 0 .6rem; }
.account-lines dd { margin: 0; }
.account-status { min-height: 1.4em; font-weight: 600; }
.request-list { list-style: none; margin: 0; padding: 0; }
.request-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .8rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.coach-form { margin-top: 1rem; padding-top: .6rem; border-top: 1px solid var(--border); max-width: 28rem; }
.accounts .card { margin-bottom: 1rem; }
.toggle { min-width: 2rem; font-weight: 700; }
.detail-row > td { background: var(--bg); padding: .6rem 1rem; }
.detail h4 { margin: .4rem 0 .3rem; }
.detail-list { list-style: none; margin: 0 0 .5rem; padding: 0; }
.detail-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .8rem; padding: .2rem 0; border-bottom: 1px solid var(--border); }
.detail .row-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0; }
/* Athlete platform: nothing that writes (the views also check the role, this is a second belt) */
.role-athlete .runner-bar, .role-athlete .plan-actions .danger, .role-athlete .card-actions, .role-athlete .create { display: none !important; }

main { padding: 1rem; max-width: 1500px; margin: 0 auto; }

/* Banners and notices */
.banner { margin: 0; padding: .6rem 1rem; }
.banner-error { background: var(--err-bg); color: #7a1510; font-weight: 600; }
.banner-warn { background: var(--warn-bg); }
.banner-tip { background: var(--info-bg); } /* neutral information (not a warning) */
.banner .btn { margin-left: .5rem; }
.banner-info { background: var(--info-bg); border-radius: var(--radius); margin-top: .75rem; font-weight: 600; }
.notice { position: fixed; bottom: .75rem; left: 50%; transform: translateX(-50%); background: #1c2430; color: #fff; border-radius: var(--radius); max-width: 90vw; }
.notice:not(:empty) { padding: .6rem 1rem; }

/* Buttons and fields */
.btn { font: inherit; padding: .45rem .8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); cursor: pointer; min-height: 2.4rem; }
.btn:hover { background: #eef1f5; }
.btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn.primary:hover { background: #094a8a; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.small { padding: .25rem .5rem; min-height: 2rem; font-size: .9rem; }
.btn.compact { padding-left: .5rem; padding-right: .5rem; min-height: 2rem; }
.btn[aria-disabled="true"] { opacity: .45; cursor: default; }

input, select, textarea { font: inherit; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text); max-width: 100%; }
input[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
input[type="number"] { width: 5.5rem; }
input[type="text"], input[type="date"] { min-width: 0; }

.field { margin: .4rem 0; }
.field label, .field legend { display: block; }
.label-text { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .15rem; }
.input-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.unit { color: var(--muted); font-size: .9rem; }
.field-error { display: block; color: var(--danger); font-size: .9rem; min-height: 0; }
.hint { color: var(--muted); font-size: .9rem; margin: .25rem 0; }
.check { display: flex; gap: .4rem; align-items: center; }
fieldset.field { border: 1px solid var(--border); border-radius: var(--radius); padding: .3rem .6rem .5rem; }
.duration-part { display: flex; flex-direction: column; font-size: .85rem; }

.card, .plan-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; }
.plan-bar { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem 1rem; }
.plan-bar .banner-info { flex-basis: 100%; }
.plan-select select { max-width: 100%; }
.plan-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.file-action { display: inline-flex; }
.plan-preview { margin: 0 0 .75rem; padding-left: 1.2rem; }
/* « ⋯ Plus » menu of the plan bar (js/views/plans.js, js/views/popover.js) */
.more-menu { position: relative; }
.more-panel { position: absolute; left: 0; top: calc(100% + .25rem); z-index: 30; display: grid; gap: .3rem; min-width: 14rem; max-width: calc(100vw - 2rem); padding: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.more-panel .btn, .more-panel .file-action { width: 100%; }
.more-panel .btn { text-align: left; }

/* Week */
.week-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .75rem; }
.week-title { margin: 0 0 0 .5rem; flex-basis: 100%; order: 1; }
.week-title.themed { margin: 0; padding: .35rem .7rem; border-radius: var(--radius); display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; }
.week-title .theme-name { font-weight: 700; }
.week-theme { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-left: .5rem; } /* same row as the week navigation */
.week-theme .label-text { display: inline; margin: 0 .3rem 0 0; }
.week-theme select { max-width: 100%; }
.theme-chip { display: inline-block; padding: .2rem .6rem; border-radius: var(--radius); font-weight: 700; border: 1px solid rgba(0, 0, 0, .25); }
.btn.themed-btn { border-width: 2px; font-weight: 600; }
.btn.themed-btn[style]:hover { filter: brightness(.93); }
.theme-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .4rem; }
.theme-row input[type=color] { width: 2.6rem; height: 2rem; padding: 0; }
.week-grid { display: grid; grid-template-columns: 1fr; gap: .6rem; }
@media (min-width: 640px) { .week-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .week-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1300px) { .week-grid { grid-template-columns: repeat(7, 1fr); } }

.day-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.day-card.today { border-color: var(--primary); border-width: 2px; }
.day-card.outside { background: #eceff3; }
.day-card h3 { text-transform: capitalize; margin: -.6rem -.6rem .2rem; padding: .4rem .6rem; color: var(--day-head-text); background: linear-gradient(135deg, var(--day-head-from), var(--day-head-to)); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.day-card.today h3 { background: linear-gradient(135deg, var(--day-head-today-from), var(--day-head-today-to)); }
.day-card.outside h3 { background: linear-gradient(135deg, var(--day-head-outside-from), var(--day-head-outside-to)); }
.day-card h3 .badge { background: var(--day-head-badge-bg); color: var(--day-head-badge-text); }
.day-card h3 .badge.muted { background: #e3eefb; color: var(--text); }
.weekday { font-weight: 700; }
.badge { display: inline-block; margin-left: .4rem; padding: 0 .4rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 600; }
.badge.muted { background: var(--muted); }
.session-card { border-top: 1px dashed var(--border); padding-top: .4rem; overflow-wrap: anywhere; }
.session-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .4rem; }
.session-comment { margin: .25rem 0; padding: .3rem .5rem; background: var(--info-bg); border-radius: var(--radius); font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; }
.comment-toggle[aria-expanded="true"] { background: var(--info-bg); }
.comment-counter { color: var(--muted); font-size: .85rem; text-align: right; }
.comment-input { width: 100%; box-sizing: border-box; resize: vertical; }
.block-summary { margin: .25rem 0; padding-left: 1.1rem; font-size: .88rem; }
.session-metrics, .day-total, .load { margin: .25rem 0; font-size: .9rem; }
.load { color: var(--muted); }
.day-total { border-top: 1px solid var(--border); padding-top: .3rem; font-weight: 600; }
.card-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.create { align-self: flex-start; margin-top: auto; }
.pager-nav { display: flex; align-items: center; gap: .5rem; }
.pager-list { list-style: none; margin: .3rem 0; padding: 0; font-size: .85rem; }
.pager-list .current { font-weight: 700; }
.metric.incomplete { border-bottom: 1px dotted var(--muted); cursor: help; }

.week-footer { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 1rem 0 0; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.week-footer dt { font-size: .85rem; color: var(--muted); }
.week-footer dd { margin: 0; font-weight: 700; font-size: 1.1rem; }

/* Dialogs */
dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; width: min(32rem, 94vw); max-height: 92vh; overflow: auto; color: var(--text); }
dialog.wide { width: min(60rem, 96vw); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

/* Session editor */
.save-state { margin: .3rem 0; font-weight: 600; }
.save-state[data-state="saved"] { color: #1b6b32; }
.save-state[data-state="error"], .save-state[data-state="invalid"] { color: var(--danger); }
.session-total { font-weight: 600; }
.block-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.block-editor { border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem; background: #fafbfc; }
.block-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin-bottom: .3rem; }
.block-metrics { color: var(--muted); font-size: .9rem; }
.block-actions { display: flex; flex-wrap: wrap; gap: .3rem; margin-left: auto; }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0 .8rem; }
.recovery-box { border-left: 3px solid var(--primary); padding-left: .7rem; margin-top: .4rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0 .8rem; }
.recovery-box .hint, .recovery-box .field-error { grid-column: 1 / -1; }
/* Groups of repetitions (nested) */
.group-editor { padding: 0; border: 0; background: none; }
.group-box { margin: 0; min-width: 0; border: 2px solid var(--primary); border-radius: var(--radius); padding: .5rem .6rem .6rem; background: #f1f6fc; }
.group-legend { font-weight: 700; padding: 0 .4rem; }
.group-children { margin: .5rem 0 .3rem; padding-left: .6rem; border-left: 3px solid var(--border); }
.group-reps { margin: .3rem 0; font-weight: 600; }
.group-reps label { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.group-add { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.skip-row { grid-column: 1 / -1; }
.block-summary li { overflow-wrap: anywhere; word-break: break-word; }
.add-block { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; margin-top: .8rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin-bottom: .6rem; }
table.records { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.records caption { text-align: left; color: var(--muted); padding-bottom: .3rem; }
table.records th, table.records td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.row-actions { white-space: nowrap; display: flex; gap: .3rem; }
.import-errors ul { color: var(--danger); }
.chart { width: 100%; overflow-x: auto; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Profile model */
.model-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .4rem 1.5rem; margin: .6rem 0; }
.model-summary dt { font-size: .85rem; color: var(--muted); }
.model-summary dd { margin: 0; font-weight: 600; }
table.zones th[scope="row"] { font-weight: 600; }
table.zones td { font-variant-numeric: tabular-nums; }
table.zones tr.group-start th, table.zones tr.group-start td { border-top: 2px solid var(--border); }
table.zones tr.flag { background: var(--info-bg); font-weight: 600; }

/* Warning alert (Riegel k out of range), creation choices and session library */
.banner.alert-strong { border: 2px solid #c98a00; border-radius: var(--radius); font-weight: 700; margin: .5rem 0; }
.choice-list, .library-list { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .5rem; }
.btn.choice { display: grid; gap: .15rem; width: 100%; text-align: left; }
.library-item { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: var(--radius); }
.library-item p { margin: .1rem 0; }
.btn[disabled] { opacity: .45; cursor: default; }

/* Pace chips and zone colours: colours come from CSS variables set by the views (never the only information) */
.pace-chip { display: inline-block; padding: 0 .3rem; border: 1px solid rgba(0, 0, 0, .3); border-radius: 4px; background: var(--chip-bg, transparent); color: var(--chip-fg, inherit); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pace-chip.neutral { border-color: var(--border); }
button.pace-chip { font: inherit; line-height: inherit; cursor: pointer; }
button.pace-chip[aria-expanded="true"] { outline: 2px solid var(--text); outline-offset: 1px; }
.abbr { cursor: help; font-weight: 600; }
/* Pace origin popover (js/views/popover.js): small panel under the chip */
.pace-wrap { position: relative; display: inline-block; }
.pace-pop { position: absolute; left: 0; top: calc(100% + .2rem); z-index: 25; display: block; min-width: 9rem; max-width: 15rem; padding: .35rem .55rem; background: var(--surface); color: var(--text); border: 1px solid var(--text); border-radius: var(--radius); box-shadow: 0 3px 10px rgba(0, 0, 0, .2); font-size: .85rem; white-space: normal; font-variant-numeric: normal; }
.pace-pop-line { display: block; }
.pace-pop-line + .pace-pop-line { color: var(--muted); }
.pace-swatch { margin-left: .4rem; font-size: .85rem; }
table.zones .zone-colored { background: var(--zc-bg); color: var(--zc-fg); }
table.zones tr.flag .zone-colored { box-shadow: inset 0 -3px 0 var(--text); }
@media print {
  .pace-chip, table.zones .zone-colored { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .day-card h3 { background: none; color: #000; border-bottom: 2px solid #000; }
  .day-card h3 .badge, .day-card h3 .badge.muted { background: none; color: #000; border: 1px solid #000; }
}
@media (forced-colors: active) {
  .day-card h3 { background: Canvas; background-image: none; color: CanvasText; border-bottom: 2px solid CanvasText; }
  .day-card.today h3 { border-bottom-width: 4px; }
  .day-card h3 .badge, .day-card h3 .badge.muted { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
  .pace-chip { border-color: CanvasText; }
  .more-panel, .pace-pop { border-color: CanvasText; }
  table.zones .zone-colored { background: Canvas; color: CanvasText; }
}

/* Profile: « Paramètres avancés » (two forms side by side on wide screens, stacked on narrow ones) */
/* Collapsible blocks (js/views/collapsible.js): native <details>, « + » when closed, « − » when open */
details.fold > summary { display: flex; align-items: center; gap: .6rem; cursor: pointer; list-style: none; font-weight: 700; font-size: 1.1rem; min-height: 2rem; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "+"; content: "+" / ""; flex: none; width: 1.5rem; height: 1.5rem; line-height: 1.35rem; text-align: center; border: 1px solid var(--border); border-radius: 50%; font-weight: 700; color: var(--primary); }
details.fold[open] > summary::before { content: "−"; content: "−" / ""; }
details.fold > summary:hover::before { background: #eef1f5; }
details.fold > .fold-body { margin-top: .6rem; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1rem; align-items: start; }
.profile-grid > .card { margin-bottom: 1rem; min-width: 0; }
@media (min-width: 900px) { .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1199px) { .profile-grid.wide-pair { grid-template-columns: minmax(0, 1fr); } }
.advanced-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; margin-top: .6rem; align-items: stretch; }
@media (min-width: 900px) { .advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.advanced-grid > .card { margin: 0; display: flex; flex-direction: column; background: #fafbfc; }
.advanced-block { margin-top: 1rem; }
.advanced-block > h3 { font-size: 1rem; margin: 0 0 .4rem; }
.advanced-grid > .card h2 { font-size: 1rem; }
.advanced-grid > .card .dialog-actions { margin-top: auto; padding-top: .6rem; }
.compact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .6rem; }
@media (min-width: 480px) { .compact-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.compact-fields .field { margin: .25rem 0; }
.compact-fields .label-text { font-size: .8rem; }
.compact-fields input, .compact-fields input[type="number"] { width: 100%; padding: .2rem .4rem; font-size: .9rem; }
.compact-fields .hint { font-size: .75rem; margin: 0; }
.riegel-choice .btn { margin-top: .3rem; }

/* PDF export: the print layout is only in the DOM while printing (see js/views/printView.js) */
.print-root { display: none; }
@page { size: A4 landscape; margin: 10mm; }
@media print {
  body > *:not(.print-root) { display: none !important; }
  body { background: #fff; color: #000; font-size: 8.5pt; line-height: 1.3; }
  .print-root { display: block; --chart-km: #1565c0; --chart-load: #c43e00; --chart-density: #6a1b9a; --chart-grid: #b5bcc6; --chart-text: #1c2430; }
  .print-root, .print-root * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-root .sr-only { display: none; }
  .print-page { break-after: page; page-break-after: always; }
  .print-page:last-child { break-after: auto; page-break-after: auto; }
  .print-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 5mm; margin: 0 0 3mm; padding-bottom: 1.5mm; border-bottom: 1.5px solid var(--primary); font-size: 9.5pt; }
  .print-head h1 { font-size: 13pt; margin: 0; }
  .print-head .print-week { font-weight: 700; }
  .print-head .print-theme { padding: .3mm 2.5mm; border-radius: 1.5mm; font-weight: 700; }
  .print-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(70mm, auto); gap: 3mm; }
  .print-card { border: 1px solid #8a94a3; border-radius: 2mm; padding: 0 0 1.5mm; break-inside: avoid; page-break-inside: avoid; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 1mm; }
  .print-card h3 { margin: 0 0 .5mm; padding: 1.2mm 3.5mm; font-size: 9pt; text-transform: capitalize; display: flex; justify-content: space-between; gap: 2mm; color: var(--day-head-text); background: linear-gradient(135deg, var(--day-head-from), var(--day-head-to)); border-radius: 1.8mm 1.8mm 0 0; }
  .print-card.outside h3 { background: linear-gradient(135deg, var(--day-head-outside-from), var(--day-head-outside-to)); }
  .print-summary h3 { background: #e3eefb; color: #073b72; }
  .print-card > :not(h3) { margin-left: 3.5mm; margin-right: 3.5mm; }
  .print-summary dl { margin: 0 3.5mm; display: grid; gap: 1.5mm; }
  .print-stat dt { font-size: 7.5pt; color: #444; }
  .print-stat dd { margin: 0; font-weight: 700; font-size: 10pt; }
  .print-session { border-top: 1px dashed #8a94a3; padding-top: 1mm; break-inside: avoid; }
  .print-session:first-of-type { border-top: 0; padding-top: 0; }
  .print-session h4 { margin: 0 0 .5mm; font-size: 8.5pt; }
  .print-root .block-summary { margin: .5mm 0; padding-left: 3.5mm; font-size: 8pt; }
  .print-root .pace-chip { padding: 0 .8mm; border-color: rgba(0, 0, 0, .35); }
  .print-root .abbr { font-weight: 700; }
  .print-metrics, .print-day-total { margin: .5mm 0; font-size: 8pt; }
  .print-day-total { border-top: 1px solid #8a94a3; padding-top: 1mm; font-weight: 700; margin-top: auto; }
  .print-comment { margin: .5mm 0; font-size: 7.5pt; font-style: italic; white-space: pre-wrap; overflow-wrap: anywhere; }
  .print-rest { margin: 1mm 0; color: #444; font-style: italic; }
  .print-warn { margin: 0 0 2mm; padding: 1mm 2mm; border: 1px solid #c98a00; background: #fff4d6; }
  .print-chart-box { max-width: 200mm; margin: 0 auto 3mm; }
  .print-totals { border-collapse: collapse; width: 100%; font-size: 8pt; }
  .print-totals thead { display: table-header-group; }
  .print-totals tr { break-inside: avoid; }
  .print-totals th, .print-totals td { text-align: left; padding: .4mm 2mm; border-bottom: 1px solid #c9d0da; }
  .print-totals tr.total th, .print-totals tr.total td { font-weight: 700; border-top: 1.5px solid #000; }
}

/* Files tab (data folder) */
.files details.folder { margin-bottom: .6rem; }
.files details.folder > summary { cursor: pointer; font-weight: 600; padding: .25rem 0; }
.files [aria-busy="true"] { cursor: progress; }

/* Backup tab: the « Avancé » disclosure holds the manual tools */
.backup .fold-body > .card { margin-bottom: 1rem; background: #fafbfc; }
.backup .fold-body > .card:last-child { margin-bottom: 0; }
