/* Workout App look: Mike's sketch. Blue ballpoint on ruled loose-leaf paper, circled buttons.
   The paper is ruled every 32px; most things sit on that rhythm (line-height 32px, rows 64px).
   Colors: --ink is the pen, --paper the sheet, --rule the printed lines, --pen-red for problems. */
@font-face { font-family: "Kalam"; src: url("kalam-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("kalam-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #1b36a3;
  --ink-soft: #3a4fae;
  --paper: #fefefb;
  --rule: #b9dfec;
  --desk: #c9c4b8;
  --pen-red: #a01540;
  --marker: #fff3a3;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; background: var(--desk); color: var(--ink); font: 400 19px/32px "Kalam", "Segoe Print", "Bradley Hand", cursive; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--pen-red); outline-offset: 2px; }

/* The sheet */
.paper {
  max-width: 470px; min-height: 100vh; margin: 0 auto; padding: 0 16px 64px 40px;
  background:
    radial-gradient(circle at 17px 112px, var(--desk) 0 9px, transparent 10px),
    radial-gradient(circle at 17px 50%, var(--desk) 0 9px, transparent 10px),
    radial-gradient(circle at 17px calc(100% - 112px), var(--desk) 0 9px, transparent 10px),
    repeating-linear-gradient(var(--paper) 0 31px, var(--rule) 31px 32px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
}

/* Top line: Add, History ... Today */
.top { display: flex; gap: 8px; align-items: center; height: 64px; }
.oval, .choice .on { border: 2px solid currentColor; border-radius: 48% 52% 46% 54% / 62% 54% 66% 50%; }
.btn { display: inline-grid; place-items: center; min-height: 44px; padding: 0 12px; font-weight: 700; text-decoration: none; white-space: nowrap; transform: rotate(-1.2deg); }
.btn:hover { background: #e4ecff; }
.btn.tilt { transform: rotate(1deg); }
.btn[aria-current] { background: #dfe7ff; }
.today { margin-left: auto; padding: 4px 16px; text-align: right; font-weight: 700; text-transform: uppercase; text-decoration: none; line-height: 20px; transform: rotate(1.5deg); }
.today small { display: block; font-size: 13px; font-weight: 400; text-transform: none; line-height: 14px; }
.today:hover { background: #e4ecff; }

h1 { font-size: 30px; line-height: 32px; padding: 16px 0; font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
h2 { font-size: 22px; line-height: 32px; font-weight: 700; margin-top: 32px; }
.soft { color: var(--ink-soft); }
.small { font-size: 15px; }
.err { color: var(--pen-red); }
.paren { font-weight: 700; min-height: 44px; }
.paren::before { content: "("; }
.paren::after { content: ")"; }
.paren:hover { text-decoration: underline; }
.center { display: block; margin: 0 auto; }

/* Home: blank, (unit), name, Show, Skip */
.row { display: grid; grid-template-columns: 44px auto minmax(0, 1fr) auto auto; gap: 7px; align-items: center; min-height: 64px; }
.amt { width: 100%; min-width: 0; height: 30px; text-align: center; font-weight: 700; background: transparent; border: 0; border-bottom: 2px solid currentColor; border-radius: 0; }
.unit { min-height: 44px; text-decoration: underline dotted; text-underline-offset: 4px; }
.unit::before { content: "("; }
.unit::after { content: ")"; }
.name { font-size: 21px; font-weight: 700; line-height: 24px; overflow-wrap: break-word; }
.name small { display: block; font-size: 14px; font-weight: 400; line-height: 16px; color: var(--ink-soft); }
.more { height: 64px; }
.margin-note { margin-top: 32px; padding: 0 10px; background: var(--marker); transform: rotate(-.4deg); }

/* Workout page */
.wname { width: 100%; height: 64px; font-size: 30px; font-weight: 700; background: transparent; border: 0; border-bottom: 2px solid currentColor; border-radius: 0; padding: 0; }
.facts > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 64px; }
dt { font-weight: 700; }
.choice { display: flex; flex-wrap: wrap; gap: 2px; }
.choice button { min-height: 44px; padding: 0 9px; border: 2px solid transparent; }
.choice button:hover { background: #e4ecff; }
.diagrams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
figure { border: 2px solid currentColor; border-radius: 6px 10px 5px 12px; background: var(--paper); padding: 4px 6px 8px; }
figcaption { font-size: 15px; line-height: 18px; }
.fig { display: block; width: 100%; height: auto; }
.fig * { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.fig .solid { fill: currentColor; }
.fig .ground { stroke-width: 2; opacity: .45; }
.lines li { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; min-height: 32px; }
.lines a { overflow-wrap: anywhere; }
.steps li { min-height: 32px; }

/* Forms */
label { display: block; font-weight: 700; margin-top: 32px; }
.field { display: block; width: 100%; margin-top: 0; padding: 6px 10px; line-height: 26px; font-weight: 400; background: var(--paper); border: 2px solid currentColor; border-radius: 5px 9px 6px 10px; }
textarea.field { resize: vertical; }
::placeholder { color: #5063b8; opacity: 1; }
.or { text-align: center; margin-top: 32px; margin-bottom: -32px; }
.primary { display: block; width: 100%; height: 64px; margin-top: 32px; font-weight: 700; background: var(--ink); color: var(--paper); border-radius: 40px 46px 38px 48px / 30px 34px 28px 36px; transform: rotate(-.6deg); }
.primary:hover { background: #142a85; }
.primary:disabled { opacity: .55; cursor: default; }
.inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.gap { margin-top: 32px; }

/* Requests, history, changes */
.entry { margin-top: 32px; }
.entry p { overflow-wrap: break-word; }
.reply { padding: 0 10px; background: var(--marker); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) rotate(-.6deg); max-width: min(92vw, 420px); padding: 6px 16px; background: var(--marker); border: 2px solid var(--ink); border-radius: 5px 9px 6px 10px; font-weight: 700; line-height: 26px; box-shadow: 0 6px 16px rgba(0, 0, 0, .22); }

/* Phones: the unit sits under the blank so the workout name has room. */
@media (max-width: 480px) {
  .row { grid-template-columns: 68px minmax(0, 1fr) auto auto; grid-template-areas: "amt name show skip" "unit name show skip"; row-gap: 0; padding: 6px 0; }
  .amt { grid-area: amt; }
  .unit { grid-area: unit; justify-self: center; min-height: 36px; }
  .name { grid-area: name; }
  .show { grid-area: show; }
  .skip { grid-area: skip; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .choice button, .primary { transition: background-color .18s cubic-bezier(.16, 1, .3, 1), transform .18s cubic-bezier(.16, 1, .3, 1); }
  .btn:active { transform: scale(.96); }
}
@media print {
  body { background: none; }
  .paper { box-shadow: none; max-width: none; }
  .top, .toast { display: none; }
}
