/* Planner: white cards over the same sky as the home page */
:root {
  color-scheme: light;
  --ink: #1a1a1a;
  --muted: #56606a;
  --line: rgba(40, 60, 80, .16);
  --card: rgba(255, 255, 255, .88);
  --accent: #3f7f86;
  --accent-ink: #fff;
  --danger: #b4492f;
  --today: #e8b04a;
  --climbing: #3f7f86;
  --general: #d9915f;
  --focus-base: #7fa98a;
  --focus-strength: #c4553f;
  --focus-power: #d9663a;
  --focus-power_endurance: #e8b04a;
  --focus-performance: #5f6fa8;
  --focus-recovery: #9aa5ad;
}
* { box-sizing: border-box; }
/* Moving between the planner's pages (the tabs of "Wiedza", the top bar) is a smooth
   cross-document view transition instead of a blank flash: the top bar, the tabs and the footer
   stay in place and only the content changes. Browsers without it navigate as before; pages
   without app.css (the home page) are left out. */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
.subnav { view-transition-name: subnav; }
.camp-footer { view-transition-name: camp; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
/* the scrollbar's place is kept, so a short page does not shift sideways against a long one */
html { background: #dce7ef; scrollbar-gutter: stable; }
body {
  margin: 0; min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  background: linear-gradient(to bottom, #7fb0d8 0%, #a5c8e3 30%, #c9dcea 65%, #dce7ef 100%) fixed;
}
/* the gradient above is the daytime fallback; sky.js sets it from the time of day. At night the
   text that sits right on the sky (top bar, breadcrumbs above the cards) turns light; cards stay white. */
body.night main > .crumbs, body.night main > .crumbs a { color: #eef2f7; }
body.night main > .crumbs .sep { color: #b4c0cd; }
a { color: var(--accent); }

/* the top bar is in topbar.css, shared with the home page */

main { max-width: 1100px; margin: 0 auto; padding: 0 16px 64px; }
.card {
  background: var(--card);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 0 0 16px;
  box-shadow: 0 1px 2px rgba(30, 50, 70, .08);
}
h1, h2, h3 { margin: 0 0 8px; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 1.6rem; font-weight: 600; }
h2 { font-size: 1.2rem; font-weight: 600; }
h2 a { color: inherit; text-decoration: none; }
h2 a:hover { text-decoration: underline; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
/* a page of running text (privacy policy) */
.prose { max-width: 760px; margin: 16px auto 0; line-height: 1.55; }
.prose h2 { margin-top: 22px; }
.prose ul { margin: 0 0 10px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.notes, .goal { white-space: pre-line; }
.heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.heading h1, .heading h2 { margin: 0; }
.heading + * { margin-top: 10px; }
.notice { background: #fbeee0; border: 1px solid #e8b04a; border-radius: 10px; padding: 10px 14px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; font-size: .95rem; }
.card .crumbs { margin: 0; }
.crumbs .sep { color: var(--muted); }
.context { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.context .muted { margin: 0; }

.pager { display: flex; gap: 6px; }
.pager a {
  min-width: 40px; padding: 4px 12px; text-align: center;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); text-decoration: none; background: #fff;
}
.pager a:hover { border-color: var(--accent); }

.totals { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); margin: 0; }
.totals span:first-child { color: var(--ink); }

.badge {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: #fff; background: var(--muted);
  vertical-align: middle;
}
.focus-base { background: var(--focus-base); }
.focus-strength { background: var(--focus-strength); }
.focus-power { background: var(--focus-power); }
.focus-power_endurance { background: var(--focus-power_endurance); color: var(--ink); }
.focus-performance { background: var(--focus-performance); }
.focus-recovery { background: var(--focus-recovery); }

/* Days of a week or microcycle: one under another, the date on the left, sessions on the right */
.days { display: flex; flex-direction: column; gap: 8px; margin: 0 0 24px; }
.day {
  background: var(--card); border-radius: 12px; padding: 10px 14px;
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 6px 12px; align-items: start;
  border-left: 4px solid transparent;
}
.day.today { border-left-color: var(--today); }
.day h3 { grid-column: 1; grid-row: 1 / span 2; font-size: .95rem; margin: 0; padding-top: 6px; text-transform: capitalize; }
.day .sessions, .day .add { grid-column: 2; }
.day .add { justify-self: start; padding: 5px 0; font-size: .9rem; color: var(--muted); text-decoration: none; }
.day .add:hover { color: var(--accent); }
/* on wide screens the sessions of one day sit side by side */
@media (min-width: 760px) {
  .day .sessions { flex-direction: row; flex-wrap: wrap; }
  .day .session { flex: 1 1 260px; max-width: 420px; }
}
/* phone: the date above its sessions, so they get the full width */
@media (max-width: 560px) {
  .day { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px 12px; }
  .day h3, .day .sessions, .day .add { grid-column: 1; grid-row: auto; }
  .day h3 { padding-top: 0; }
  .day .add { padding: 2px 0; }
}

.sessions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.session {
  display: flex; gap: 8px; align-items: flex-start;
  background: #fff; border-radius: 8px; padding: 7px 8px;
  border-left: 4px solid var(--muted);
}
.session.kind-climbing { border-left-color: var(--climbing); }
.session.kind-general { border-left-color: var(--general); }
.session a { display: flex; flex-direction: column; min-width: 0; color: var(--ink); text-decoration: none; }
.session a:hover .title { text-decoration: underline; }
.session .title { font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.session .meta { font-size: .8rem; color: var(--muted); }
.session.done .title { text-decoration: line-through; color: var(--muted); }
.check {
  flex: none; width: 22px; height: 22px; padding: 0; margin-top: 1px;
  border: 1.5px solid var(--line); border-radius: 6px; background: #fff;
  color: transparent; font-size: .8rem; line-height: 1; cursor: pointer;
}
.check:hover { border-color: var(--accent); color: var(--line); }
.check[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Proportional timeline of child cycles */
.timeline {
  position: relative; height: 34px; margin: 14px 0 4px;
  background: rgba(40, 60, 80, .07); border-radius: 8px; overflow: hidden;
}
.timeline .seg {
  position: absolute; top: 0; bottom: 0;
  display: flex; align-items: center; padding: 0 8px;
  color: #fff; font-size: .8rem; font-weight: 600; text-decoration: none;
  border-right: 2px solid #fff; overflow: hidden;
}
.timeline .seg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline .seg.focus-power_endurance { color: var(--ink); }
.timeline .seg:hover { filter: brightness(1.08); }
.timeline .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); pointer-events: none; }
.timeline-scale { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: 10px; }

.cycles { list-style: none; margin: 0; padding: 0; }
.cycles li {
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--line);
}
.cycles li:first-child { border-top: 0; }
.cycles a { font-weight: 600; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 0; list-style: none; color: var(--muted); }

/* Forms */
form { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.field .label { font-size: .85rem; font-weight: 600; }
.field small { color: var(--muted); font-size: .8rem; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row .field { min-width: 150px; }
input, select, textarea {
  font: inherit; color: inherit;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
/* Same look and height for selects, dates and numbers everywhere: phones (iOS above all) draw them
   their own way, with widths from the longest option or the date, which broke the rows. */
input, select, textarea { min-width: 0; max-width: 100%; }
select, input[type="date"], input[type="number"] {
  -webkit-appearance: none; appearance: none;
  min-height: 40px; line-height: 1.3;
}
select {
  padding-right: 32px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2356606a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center / 12px 8px;
}
input[type="date"] { display: block; width: 100%; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
textarea { resize: vertical; }
.check-field { display: flex; align-items: center; gap: 8px; }
.check-field input { width: auto; }
.form-error { color: var(--danger); margin: 0; min-height: 0; }
.form-error:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 4px; }
button, .button {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
}
button:hover, .button:hover { filter: brightness(1.08); }
button.danger { background: #fff; border-color: var(--danger); color: var(--danger); }
/* "Edit …" sections: folded, they are a slim bar set apart from the content cards above */
details.card:not([open]) { padding: 10px 22px; background: rgba(255, 255, 255, .7); box-shadow: none; border: 1px dashed var(--line); }
details.card > summary { cursor: pointer; font-weight: 600; }
details.card[open] > summary { margin-bottom: 4px; }
details.card > .actions { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

@media (max-width: 560px) {
  .card { padding: 16px; }
  h1 { font-size: 1.35rem; }
}

/* Exercises of a session (editor) */
fieldset.exercises { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; margin: 0; min-width: 0; }
fieldset.exercises legend { font-size: .85rem; font-weight: 600; padding: 0 4px; }
.exercise-list { display: flex; flex-direction: column; gap: 10px; }
.exercise-list:empty::before { content: "Brak ćwiczeń – dodaj z biblioteki lub własne."; color: var(--muted); font-size: .9rem; }
.exercise-row {
  display: flex; flex-direction: column; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px;
}
.ex-head { display: flex; gap: 6px; align-items: flex-start; }
.ex-head textarea { font-weight: 600; flex: 1; min-width: 0; }
textarea[data-autosize] { resize: none; overflow: hidden; line-height: 1.35; field-sizing: content; }
.ex-info {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); text-decoration: none; font-weight: 600;
}
.ex-dose { display: grid; gap: 6px; grid-template-columns: 70px repeat(3, minmax(0, 1fr)); }
.ex-dose label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-dose span { font-size: .75rem; color: var(--muted); }
.ex-dose input, .ex-dose textarea, .exercise-row > textarea { padding: 6px 8px; font-size: .92rem; }
.ex-dose input, .ex-dose textarea { min-height: 36px; }
@media (max-width: 560px) {
  .ex-dose { grid-template-columns: 1fr 1fr; }
  .ex-dose label:nth-child(3) { grid-column: 1 / -1; } /* load: usually the longest text */
}
.add-exercise { display: flex; gap: 8px; margin-top: 10px; }
.add-exercise select { flex: 1; min-width: 0; }
button.icon { flex: none; width: 32px; height: 32px; padding: 0; background: #fff; color: var(--ink); border-color: var(--line); }
button.icon.danger { color: var(--danger); }
button.secondary, .button.secondary { background: #fff; color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; filter: none; }
a.button { display: inline-block; text-decoration: none; }

/* Generator preview and exercise library */
.preview-sessions { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.preview-sessions li { display: flex; flex-direction: column; }
.principles { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
/* tabs of "Wiedza": techniques, the library, muscle groups and injuries
   (partials/knowledge_tabs.html); pills on the sky, like the top bar */
.subnav {
  display: flex; flex-wrap: wrap; gap: 4px; width: fit-content; max-width: 100%; margin: 0 0 12px; padding: 4px;
  border-radius: 999px; background: rgba(255, 255, 255, .45);
}
.subnav a { padding: 6px 14px; border-radius: 999px; color: var(--ink); text-decoration: none; font-size: .95rem; }
.subnav a:hover { background: rgba(255, 255, 255, .6); }
.subnav a[aria-current] { background: var(--card); font-weight: 600; box-shadow: 0 1px 2px rgba(30, 50, 70, .08); }
body.night .subnav { background: rgba(255, 255, 255, .18); }
body.night .subnav a:not([aria-current]) { color: #eef2f7; }
.muscle-links { font-size: .9rem; color: var(--muted); margin: 2px 0 8px; }
.muscle-links + .muscle-links { margin-top: -6px; }
[id^="cat-"] { scroll-margin-top: 16px; }
/* phones: narrower pills, so the four tabs fit one line */
@media (max-width: 560px) {
  .subnav a { padding: 6px 9px; font-size: .9rem; }
}

/* The library (/exercises, templates/exercises.html): the exercises on the left, the chosen one's animation pinned on the
   right, as on the techniques and muscle group pages; on phones the animation is pinned on top */
.lib { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 16px; align-items: start; }
.lib-side { position: sticky; top: 16px; }
.lib-anim h2 { font-size: 1.1rem; }
.lib-anim .exercise-3d { max-width: none; }
.lib-how { margin: 0; font-size: .92rem; }
.lib-no-anim { margin: 4px 0 10px; }
.exercise-card[data-key] { cursor: pointer; border-radius: 10px; padding-left: 10px; padding-right: 10px; margin: 0 -10px; }
.exercise-card[data-key]:hover { background: rgba(63, 127, 134, .06); }
.exercise-card.active { background: rgba(63, 127, 134, .1); box-shadow: inset 3px 0 0 var(--accent); }
.exercise-card[data-key]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.anim-badge { font-size: .72rem; font-weight: 600; vertical-align: middle; }
@media (max-width: 860px) {
  .lib { grid-template-columns: 1fr; }
  .lib-side { order: -1; top: 8px; z-index: 2; }
  .lib-anim { padding: 12px 14px; }
  .lib-anim .exercise-3d { max-width: 34dvh; }
  .lib-anim .lib-how, .lib-anim figcaption { display: none; }
  /* a card scrolled to (?e=, ?c=) is not hidden under the pinned animation */
  .lib .exercise-card, .lib [id^="cat-"] { scroll-margin-top: calc(34dvh + 110px); }
}
.exercise-card { padding: 12px 0; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.exercise-card:first-of-type { border-top: 0; }
.exercise-card:target, .exercise-card:focus-within { background: none; }
.exercise-card h3 { font-size: 1rem; }
.exercise-card h3 .muted { font-weight: 400; font-size: .85rem; }
.exercise-anim { margin: 8px 0 10px; text-align: center; }
/* the colour is the caption's and the countdown's drawn on the canvas (static/js/anim/mount.js) */
.exercise-3d {
  display: block; width: 100%; max-width: 280px; aspect-ratio: 1; margin: 0 auto; color: var(--muted);
  cursor: grab; touch-action: pan-y; border-radius: 10px; background: #f6f8f5;
}
.exercise-3d:active { cursor: grabbing; }
.exercise-anim figcaption { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.doses { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0 0 6px; font-size: .9rem; }
.doses dt { font-weight: 600; }
.doses dd { margin: 0; color: var(--muted); }
fieldset.weekdays { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
fieldset.weekdays legend { font-size: .85rem; font-weight: 600; padding: 0; margin-bottom: 4px; }
fieldset.weekdays small { color: var(--muted); font-size: .8rem; }
.day-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.day-choice {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.day-choice input { width: auto; }
.day-choice:has(input:checked) { border-color: var(--accent); background: #e6f1f2; font-weight: 600; }
.bibliography { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
.bibliography a { overflow-wrap: anywhere; }

/* Session read view */
.exercise-read { margin: 12px 0 4px; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.exercise-read li { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.exercise-read .dose { color: var(--ink); }
.exercise-read .ex-notes { color: var(--muted); font-style: italic; }
.exercise-read details { color: var(--muted); font-size: .92rem; }
.exercise-read summary { cursor: pointer; color: var(--accent); width: fit-content; }
.exercise-read details p { margin: 4px 0 0; }
.done-badge { background: var(--accent); }

/* Unfoldable hint next to a field label (RPE) */
.field .label { display: inline-flex; align-items: center; gap: 6px; }
.hint-toggle {
  width: 22px; height: 22px; padding: 0; border-radius: 50%;
  background: #fff; color: var(--accent); border: 1px solid var(--accent);
  font-size: .8rem; line-height: 1;
}
.hint-toggle[aria-expanded="true"] { background: var(--accent); color: #fff; }
.hint {
  background: #f3f7f8; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: .9rem; color: var(--ink);
}
.hint p { margin: 0 0 8px; }
.hint p:last-child { margin: 8px 0 0; color: var(--muted); }
.rpe-scale { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; }
.rpe-scale dt { font-weight: 600; text-align: right; }
.rpe-scale dd { margin: 0; }

.title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card > .title-row { margin-bottom: 8px; }
.title-row h1 { margin: 0; }
.title-row h1 { overflow-wrap: anywhere; }
.back-arrow {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 1.2rem; text-decoration: none;
}
.back-arrow:hover { border-color: var(--accent); color: var(--accent); }
.actions.end { justify-content: flex-end; }

/* Campsite from the home page (templates/partials/camp.html) as the footer: at the bottom of the
   page on the right, after the content, so it never sits behind the cards. The body is a column
   so the footer stays at the bottom of the window on short pages too. */
body { display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
/* safety net: nothing too wide may make the page scroll sideways (iOS shows it as a wobble) */
body { overflow-x: clip; }
.camp-footer {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  margin-top: -24px; padding-left: 16px;
}
.camp-footer .camp { pointer-events: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-bottom: 14px; font-size: .9rem; }
.footer-links a { color: var(--muted); }
.footer-links a[aria-current] { color: var(--ink); font-weight: 600; }
body.night .footer-links a { color: #b4c0cd; }
body.night .footer-links a[aria-current] { color: #eef2f7; }
.camp-footer .camp { display: block; width: min(46vw, 560px); height: auto; }
@media (max-width: 560px) {
  /* phone: the links above the campsite, which takes the full width */
  .camp-footer { flex-direction: column; align-items: stretch; padding-left: 0; }
  .footer-links { padding: 0 16px 4px; }
  .camp-footer .camp { width: 92vw; align-self: flex-end; }
}
body.night .camp .scene { filter: brightness(.42) saturate(.75); }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.6s ease-in-out infinite; }
.flame.inner { animation-duration: 1.1s; animation-delay: -.4s; }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1); }
  30% { transform: scale(.92, 1.08) skewX(-3deg); }
  60% { transform: scale(1.05, .94) skewX(2deg); }
}
.smoke { animation: rise 6s linear infinite; opacity: 0; }
.smoke.s2 { animation-delay: -3s; }
@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: .35; }
  100% { transform: translate(-14px, -70px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .flame, .smoke { animation: none; } }

/* Account copy of the plan (sync.js) */
#sync-prompt { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
#sync-prompt:empty { display: none; }
.sync-card { border-left: 4px solid var(--accent); }
.sync-status { display: block; flex-basis: 100%; margin-top: 0; color: var(--muted); font-size: .85rem; }
.sync-status[data-status="offline"], .sync-status[data-status="login"], .sync-status[data-status="outdated"],
.sync-status[data-status="unavailable"] { color: var(--danger); }
body.night .sync-status { color: #b4c0cd; }

/* iOS zooms into any field under 16px when it gets focus (and the page stays zoomed): not on phones */
@media (max-width: 560px) {
  input, select, textarea, .ex-dose input, .ex-dose textarea, .exercise-row > textarea { font-size: 16px; }
}

/* Moving a session: drag in the week view, or the "Przenieś" card of a session */
.session[draggable="true"] { cursor: grab; }
.session.dragging { opacity: .45; }
.day.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; background: #eef6f6; }
.move-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
/* Touch dragging (app.js): no link preview, callout or text selection on a long press of a session,
   and the copy that follows the finger */
.session { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.session a { -webkit-touch-callout: none; }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 10; margin: 0; pointer-events: none;
  list-style: none; opacity: .92; box-shadow: 0 8px 20px rgba(20, 40, 60, .28);
  transform-origin: center; will-change: transform;
}
.pager a.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; background: #eef6f6; }
/* "Only this one or all of them?" when moving a session of a plan to another weekday */
.move-dialog {
  max-width: min(440px, calc(100vw - 32px)); padding: 18px 20px; border: 0; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(20, 40, 60, .3); color: var(--ink);
}
.move-dialog::backdrop { background: rgba(20, 30, 40, .35); }
.move-dialog p { margin: 0 0 10px; }

/* admin page: accounts */
.admin-table { overflow-x: auto; }
.admin-table table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.admin-table th, .admin-table td { padding: 6px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.admin-table th { font-weight: 600; color: var(--muted); }

/* admin page: the generator's templates as a map of its decisions (js/plan/admin-rules.js) */
.rules-params { position: sticky; top: 0; z-index: 2; margin: 12px -22px 0; padding: 10px 22px; background: var(--card); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.rule-step { padding: 18px 0 4px; border-top: 1px solid var(--line); margin-top: 16px; }
.rule-step h3 { font-size: 1rem; margin: 14px 0 6px; }
.rule-step .principles { margin: 10px 0; font-size: .92rem; }
.rule-step details { margin: 10px 0; }
.rule-step summary { cursor: pointer; color: var(--accent); }
.wave-patterns { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.wave-pattern { display: grid; grid-template-columns: 140px 1fr; gap: 10px; align-items: center; margin: 6px 0; }
.wave-pattern .label { font-size: .85rem; font-weight: 600; }
.wave-pattern.unused { opacity: .45; }
.block-bar { display: flex; gap: 2px; min-width: 0; }
.block-bar .badge { min-width: 0; border-radius: 6px; padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rule-chip {
  display: inline-block; padding: 2px 8px; margin: 1px 0; border-radius: 6px; border-left: 4px solid var(--muted);
  background: rgba(40, 60, 80, .06); color: var(--ink); font-size: .82rem; text-decoration: none; white-space: normal;
}
a.rule-chip:hover { background: rgba(40, 60, 80, .12); }
.rule-chip.kind-climbing { border-left-color: var(--climbing); }
.rule-chip.kind-general { border-left-color: var(--general); }
.rule-weeks td, .rule-preview td { white-space: normal; vertical-align: top; }
.rule-weeks td { min-width: 150px; }
.rule-weeks ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; font-size: .8rem; }
.rule-weeks .current { background: rgba(63, 127, 134, .1); }
.rule-weeks .override { outline: 2px dashed var(--today); outline-offset: -3px; }
.rule-progress table { width: auto; }
.rule-progress td { text-align: center; min-width: 36px; font-weight: 600; }
.rule-progress .intro { background: rgba(127, 169, 138, .25); }
.rule-progress .peak { background: rgba(196, 85, 63, .25); }
.rule-progress .deload { background: rgba(154, 165, 173, .35); }
.rule-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.rule-template { border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 10px; padding: 10px 12px; scroll-margin-top: 90px; }
.rule-template.kind-climbing { border-left-color: var(--climbing); }
.rule-template.kind-general { border-left-color: var(--general); }
.rule-template:target { box-shadow: 0 0 0 3px var(--today); }
.rule-template.active { border-color: var(--accent); background: rgba(63, 127, 134, .08); }
.rule-template.unused { opacity: .6; }
.rule-template h3 { margin: 0 0 4px; }
.rule-template h3 .muted { font-weight: 400; font-size: .8rem; }
.rule-template p { font-size: .85rem; margin: 0 0 6px; }
.rule-exercises { margin: 0; padding-left: 20px; font-size: .88rem; }
.rule-exercises li { display: flex; flex-direction: column; margin-bottom: 3px; }
.rule-exercises .muted { font-size: .8rem; }
.rule-exercises .dropped > span:first-child { text-decoration: line-through; color: var(--muted); }
.rule-variants { margin: 8px 0 0; padding-left: 18px; font-size: .8rem; color: var(--muted); }
.rule-variants .active { color: var(--ink); }
@media (max-width: 560px) {
  .wave-pattern { grid-template-columns: 1fr; gap: 4px; }
  .rules-params { margin: 12px -16px 0; padding: 10px 16px; }
}

/* Account pages (sign-in, sign-up, password) and the account page */
.auth .card { max-width: 460px; margin-left: auto; margin-right: auto; }
.auth-other { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.auth .muted { margin-top: 14px; }
.notice { color: var(--accent); margin: 0; }
.token-link { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; word-break: break-all; user-select: all; }
form.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; margin: 0; }

/* How a plan is built (the plans page): a quiet fold under the page's lead */
.plan-structure { margin: 4px 0 8px; }
.plan-structure > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.plan-structure ul { margin: 10px 0 8px; padding-left: 20px; display: grid; gap: 6px; }
.plan-structure p { margin: 0; }

/* One exercise's page (/exercises/<key>, templates/exercise.html) */
.exercise-page h2 { font-size: 1.05rem; margin-top: 18px; }
.exercise-page .crumbs { margin: 0; }
.exercise-page .back { font-size: 1.4rem; line-height: 1; text-decoration: none; }
.exercise-page .back:hover { opacity: .7; }
.exercise-links { columns: 2 220px; margin: 0; padding-left: 18px; }
.exercise-links li { break-inside: avoid; margin-bottom: 4px; }
