/* The Healthy Grandparent
   Built for readers over 60: large type, strong contrast,
   big targets, visible focus, no motion, nothing hidden. */

:root {
  --ink:      #191c1a;
  --ink-2:    #4a514c;
  --paper:    #faf8f4;
  --card:     #ffffff;
  --rule:     #dcd8ce;
  --green:    #23543f;
  --green-bg: #e9f1ec;
  --amber-bg: #fdf7e6;
  --amber:    #c9a227;
  --red:      #8c2f22;
  --red-bg:   #fbeeec;

  /* Block tones. Colour says what KIND of work a block is.
     It never carries meaning alone -- every block also has a
     kicker and a heading that say the same thing in words.
     All pairs are >=7:1 against their own tint. */
  --plum:     #6d3d5f;
  --plum-bg:  #f4ecf2;
  --blue:     #1b4664;
  --blue-bg:  #e9f0f6;
  --slate:    #414a44;
  --slate-bg: #eeeeea;

  --base: 20px;
  --tap: 3rem;
  --r: 12px;
}

html[data-size="l"]  { --base: 23px; }
html[data-size="xl"] { --base: 27px; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--base); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 Georgia, 'Iowan Old Style', 'Times New Roman', serif;
}

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.1rem; }

.skip { position: absolute; left: -9999px; background: var(--green); color: #fff; padding: 1rem; z-index: 9; }
.skip:focus { left: 1rem; top: 1rem; }

/* header */
.head { background: var(--card); border-bottom: 2px solid var(--rule); }
.head-row {
  display: flex; flex-wrap: wrap; gap: .8rem;
  align-items: center; justify-content: space-between;
  padding: .9rem 1.1rem;
}
.brand { font-size: 1.15rem; font-weight: 700; color: var(--green); line-height: 1.2; }
.sizer { display: flex; align-items: center; gap: .3rem; }
.sizer-lab { font-size: .72rem; color: var(--ink-2); margin-right: .2rem; }
.sizer button {
  min-width: 2.5rem; min-height: 2.5rem; cursor: pointer;
  border: 2px solid var(--rule); background: var(--card);
  border-radius: 8px; color: var(--ink); font-family: inherit;
}
.sizer button:nth-of-type(1) { font-size: .8rem; }
.sizer button:nth-of-type(2) { font-size: 1rem; }
.sizer button:nth-of-type(3) { font-size: 1.25rem; }
.sizer button[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }

/* headings */
h1 { font-size: 1.95rem; line-height: 1.22; margin: 0 0 .7rem; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 0 0 .9rem; }
.lede { font-size: 1.08rem; color: var(--ink-2); margin: 0 0 1.5rem; }
.date {
  margin: 0 0 .5rem; font-size: .8rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-2);
}
.fine { font-size: .8rem; color: var(--ink-2); }

.picker, .today { padding: 2.4rem 1.1rem 3rem; }

/* level picker */
.levels { display: grid; gap: .8rem; }
.lvl {
  min-height: var(--tap); padding: 1.1rem; cursor: pointer; text-align: left;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--rule); border-radius: var(--r); font-family: inherit;
}
.lvl:hover { border-color: var(--green); }
.lvl-t { display: block; font-size: 1.15rem; font-weight: 700; margin-bottom: .2rem; }
.lvl-s { display: block; font-size: .92rem; color: var(--ink-2); line-height: 1.5; }

/* your level line */
.yourlevel { font-size: .92rem; color: var(--ink-2); margin: 0 0 1.5rem; }
.link {
  background: none; border: 0; padding: .35rem .4rem; margin-left: .3rem;
  color: var(--green); font: inherit; font-size: .92rem;
  text-decoration: underline; cursor: pointer;
}

/* place toggle */
.places { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-bottom: 1.8rem; }
@media (max-width: 32rem) { .places { grid-template-columns: 1fr; } }
.place {
  min-height: var(--tap); padding: .9rem; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: .15rem;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--rule); border-radius: var(--r); font-family: inherit;
}
.place-t { font-size: 1rem; font-weight: 700; }
.place-s { font-size: .78rem; color: var(--ink-2); }
.place.on { border-color: var(--green); background: var(--green-bg); }
.place.on .place-t { color: var(--green); }

/* blocks */
.block {
  --tone: var(--green); --tone-bg: var(--green-bg);
  background: var(--card); border: 2px solid var(--rule);
  border-radius: var(--r); padding: 1.4rem; margin-bottom: 1.1rem;
}
.block.t-warm     { --tone: var(--plum);  --tone-bg: var(--plum-bg); }
.block.t-strength { --tone: var(--blue);  --tone-bg: var(--blue-bg); }
.block.t-balance  { --tone: var(--green); --tone-bg: var(--green-bg); }
.block.t-rest     { --tone: var(--slate); --tone-bg: var(--slate-bg); }

.block-head {
  background: var(--tone-bg);
  margin: -1.4rem -1.4rem 1.2rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 2px solid var(--rule);
  border-radius: 10px 10px 0 0;
}
.kicker {
  margin: 0 0 .25rem; font-size: .76rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--tone); font-weight: 700;
}
.block-head h2 { margin: 0; }
.block-note { font-size: .92rem; color: var(--ink-2); margin: .4rem 0 0; }

/* movement list */
.moves { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.moves > li {
  counter-increment: n; padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 2rem 1fr; gap: .8rem;
}
.moves > li:first-child { border-top: 0; padding-top: 0; }
.moves > li::before {
  content: counter(n);
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--tone-bg); color: var(--tone);
  font-size: .9rem; font-weight: 700;
  display: grid; place-items: center;
}
.mv-name { font-size: 1.12rem; font-weight: 700; margin: 0 0 .1rem; }
.mv-dose { margin: 0 0 .5rem; color: var(--tone); font-weight: 700; font-size: .95rem; }
.mv-how { margin: 0; }
.mv-watch {
  margin: .6rem 0 0; padding: .55rem .7rem; font-size: .86rem;
  background: var(--amber-bg); border-left: 4px solid var(--amber); border-radius: 5px;
}
.mv-note {
  margin: .5rem 0 0; padding: .55rem .7rem; font-size: .86rem;
  background: var(--tone-bg); border-left: 4px solid var(--tone); border-radius: 5px;
}
.mv-weight { font-size: .82rem; color: var(--ink-2); margin: .3rem 0 0; font-style: italic; }

/* rest + walk days */
.big-note { text-align: left; }
.big-note ul { margin: .8rem 0 0; padding-left: 1.2rem; }
.big-note li { margin-bottom: .5rem; }

/* actions */
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.6rem 0 2.4rem; }
.btn {
  min-height: var(--tap); padding: 0 1.4rem; cursor: pointer;
  background: var(--green); color: #fff; border: 2px solid var(--green);
  border-radius: var(--r); font: inherit; font-weight: 700;
}
.btn:hover { opacity: .92; }

/* stop rules */
.stop {
  background: var(--red-bg); border: 2px solid var(--red);
  border-radius: var(--r); padding: 1.4rem;
}
.stop h2 { color: var(--red); }
.stop ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.stop li { margin-bottom: .45rem; font-weight: 700; }

/* footer */
.foot { border-top: 2px solid var(--rule); padding: 1.8rem 0 2.6rem; margin-top: 1rem; }
.foot p { font-size: .88rem; color: var(--ink-2); max-width: 40rem; }

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

@media print {
  .head, .places, .actions, .foot, .skip, .yourlevel, .lede { display: none; }
  body { background: #fff; font-size: 11.5pt; }
  .block, .stop { border: 1px solid #000; page-break-inside: avoid; }
  .mv-watch, .mv-note { background: #fff; border-left: 2px solid #000; }
  .block-head { background: #fff; margin: 0 0 .6rem; padding: 0; border-bottom: 1px solid #000; }
}

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

/* [hidden] must beat any display rule set by a class */
[hidden] { display: none !important; }

/* ============ navigation ============ */
.nav { background: var(--card); border-bottom: 2px solid var(--rule); }
.nav-row { display: flex; gap: .3rem; flex-wrap: wrap; padding: 0 1.1rem; }
.nav-row a {
  padding: .85rem .9rem; min-height: var(--tap);
  display: flex; align-items: center;
  color: var(--ink-2); text-decoration: none;
  font-size: .95rem; border-bottom: 4px solid transparent;
}
.nav-row a:hover { color: var(--green); }
.nav-row a[aria-current="page"] {
  color: var(--green); font-weight: 700; border-bottom-color: var(--green);
}

/* ============ home page ============ */
.hero { padding: 3rem 1.1rem 2rem; }
.hero h1 { font-size: 2.4rem; max-width: 18ch; }
.hero-lede { font-size: 1.15rem; color: var(--ink-2); max-width: 38rem; margin: 0 0 1.8rem; }
.hero-cta { margin: 0 0 .8rem; }
.hero-cta .btn { display: inline-flex; align-items: center; text-decoration: none; }
.hero-free { font-size: .88rem; color: var(--ink-2); margin: 0; }

.band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem; padding: 1rem 1.1rem 2.5rem;
}
.stat { background: var(--card); border: 2px solid var(--rule); border-radius: var(--r); padding: 1.3rem; }
.stat-n { margin: 0; font-size: 2.2rem; font-weight: 700; color: var(--green); line-height: 1; }
.stat-t { margin: .35rem 0 .5rem; font-weight: 700; }
.stat-s { margin: 0; font-size: .88rem; color: var(--ink-2); }

.prose { padding: 1rem 1.1rem 3rem; }
.prose h2 { margin-top: 2.4rem; }
.prose p { max-width: 38rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 1.2rem 0 1rem; }
.mini { background: var(--card); border: 2px solid var(--rule); border-radius: var(--r); padding: 1.2rem; }
.mini-k { margin: 0 0 .3rem; font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--green); font-weight: 700; }
.mini h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.mini p { margin: 0; font-size: .92rem; color: var(--ink-2); }

/* ============ library ============ */
.lib { padding: 2.4rem 1.1rem 3rem; }

.filters {
  display: grid; gap: 1.2rem; margin: 1.5rem 0;
  background: var(--card); border: 2px solid var(--rule);
  border-radius: var(--r); padding: 1.3rem;
}
.filter { border: 0; padding: 0; margin: 0; min-width: 0; }
.filter label, .filter legend {
  display: block; font-size: .82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-2); margin-bottom: .55rem; padding: 0;
}
#q {
  width: 100%; min-height: var(--tap); padding: .6rem .8rem;
  font: inherit; color: var(--ink); background: var(--paper);
  border: 2px solid var(--rule); border-radius: 8px;
}
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  min-height: 2.6rem; padding: .4rem .9rem; cursor: pointer;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--rule); border-radius: 999px;
  font: inherit; font-size: .9rem;
}
.chip:hover { border-color: var(--green); }
.chip[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }

.count { font-size: .88rem; color: var(--ink-2); margin: 0 0 1.2rem; }
.empty { font-size: 1rem; color: var(--ink-2); }

.ex-group { margin-bottom: 2.2rem; }
.ex-group-h {
  font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--green); border-bottom: 2px solid var(--rule);
  padding-bottom: .5rem; margin-bottom: 1rem;
}
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; }
.ex {
  background: var(--card); border: 2px solid var(--rule);
  border-radius: var(--r); padding: 1.2rem;
}
.ex-head { margin-bottom: .6rem; }
.ex-kind { margin: 0 0 .15rem; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.ex-name { margin: 0; font-size: 1.2rem; }
.ex-dose { margin: 0 0 .6rem; color: var(--green); font-weight: 700; font-size: .95rem; }
.ex-how { margin: 0; font-size: .95rem; }
.ex-weight { margin: .5rem 0 0; font-size: .82rem; color: var(--ink-2); font-style: italic; }
.ex-levels { margin: .8rem 0 0; font-size: .82rem; color: var(--ink-2); }
.ex-levels-lab { font-weight: 700; }

/* ============ sign in ============ */
.signin { padding: 2.4rem 1.1rem 3rem; max-width: 34rem; }
.signin form { margin: 1.5rem 0; }
.signin label {
  display: block; font-weight: 700; margin-bottom: .5rem; font-size: 1rem;
}
.signin input[type="email"] {
  width: 100%; min-height: var(--tap); padding: .7rem .9rem; margin-bottom: 1rem;
  font: inherit; color: var(--ink); background: var(--card);
  border: 2px solid var(--rule); border-radius: 8px;
}
.signin input[type="email"]:focus-visible { border-color: var(--green); }
.msg { margin: 1rem 0 0; font-size: .95rem; }
.msg.good { color: var(--green); font-weight: 700; }
.msg.bad  { color: var(--red);  font-weight: 700; }
.aside {
  margin-top: 2.5rem; padding: 1.3rem;
  background: var(--card); border: 2px solid var(--rule); border-radius: var(--r);
}
.aside h2 { font-size: 1.1rem; }
.aside p { margin: 0; font-size: .92rem; color: var(--ink-2); }
code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .85em; background: var(--green-bg); padding: .1em .35em; border-radius: 4px;
}

/* ============ done button ============ */
.done-btn { background: var(--green); }
.done-btn.is-done {
  background: var(--green-bg); color: var(--green); cursor: default;
}
.done-msg { font-size: .9rem; color: var(--ink-2); margin: -1rem 0 2rem; }
.done-msg a { color: var(--green); }

/* ============ progress ============ */
.prog { padding: 2.4rem 1.1rem 3rem; }
.prog .band { padding: 1.2rem 0 2rem; }
.prog h2 { margin-top: 2rem; }

.grid {
  display: grid; grid-template-columns: repeat(14, 1fr);
  gap: 4px; max-width: 26rem; margin: 1rem 0 0;
}
.cell {
  aspect-ratio: 1; border-radius: 3px;
  background: var(--card); border: 1px solid var(--rule);
}
.cell.is-done { background: var(--green); border-color: var(--green); }
.cell.is-rest { background: var(--paper); border-style: dashed; }

.hist { list-style: none; margin: 1rem 0 0; padding: 0; }
.hist li {
  display: flex; flex-wrap: wrap; gap: .3rem 1rem; justify-content: space-between;
  padding: .85rem 0; border-bottom: 1px solid var(--rule);
}
.hist-when { font-weight: 700; }
.hist-what { color: var(--ink-2); }
.hist-empty { color: var(--ink-2); border-bottom: 0; }

/* ============ movement links ============ */
.mv-link { color: inherit; text-decoration: none; border-bottom: 2px solid var(--green-bg); }
.mv-link:hover, .mv-link:focus-visible { color: var(--green); border-bottom-color: var(--green); }
.mv-name .mv-link::after { content: ' ›'; color: var(--green); font-weight: 700; }

/* ============ new-here strip ============ */
.whatis {
  background: var(--green-bg); border-radius: var(--r);
  padding: 1.4rem; margin-bottom: 1.1rem;
}
.whatis h2 { margin-bottom: .6rem; }
.whatis p { margin: 0 0 .7rem; font-size: .95rem; }
.whatis p:last-child { margin-bottom: 0; }

/* ============ single exercise page ============ */
.ex-page { padding: 1.6rem 1.1rem 3rem; max-width: 36rem; }
.backlink { margin: 0 0 1.5rem; font-size: .95rem; }
.backlink a { color: var(--green); }
.ex-eyebrow {
  margin: 0 0 .3rem; font-size: .8rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-2); font-weight: 700;
}
.ex-page h1 { font-size: 2.1rem; margin-bottom: 1.2rem; }

.howmany {
  background: var(--green); color: #fff;
  border-radius: var(--r); padding: 1.1rem 1.3rem; margin-bottom: 1.4rem;
}
.howmany-lab {
  margin: 0 0 .2rem; font-size: .78rem; letter-spacing: .08em;
  text-transform: uppercase; opacity: .85;
}
.howmany-n { margin: 0; font-size: 1.55rem; font-weight: 700; line-height: 1.2; }
.howmany-s { margin: .35rem 0 0; font-size: .82rem; opacity: .85; }

.ex-need {
  background: var(--card); border: 2px solid var(--rule);
  border-radius: var(--r); padding: .9rem 1.1rem; margin-bottom: 1.6rem;
}
.steps-h { font-size: 1.25rem; margin-bottom: 1rem; }
.steps { list-style: none; counter-reset: s; margin: 0 0 1.6rem; padding: 0; }
.steps li {
  counter-increment: s;
  display: grid; grid-template-columns: 2.4rem 1fr; gap: .9rem; align-items: start;
  padding: .9rem 0; border-bottom: 1px solid var(--rule);
  font-size: 1.1rem; line-height: 1.5;
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(s);
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--green); color: #fff;
  font-size: 1.05rem; font-weight: 700;
  display: grid; place-items: center;
}
.ex-how-long { font-size: 1.1rem; margin-bottom: 1.5rem; }

.watchbox {
  background: var(--amber-bg); border-left: 5px solid var(--amber);
  border-radius: 6px; padding: 1.1rem 1.3rem; margin-bottom: 1.4rem;
}
.watchbox h2 { font-size: 1.05rem; margin-bottom: .45rem; }
.watchbox p { margin: 0; }

.ex-page .stop { margin-bottom: 1.4rem; }
.ex-page .stop h2 { font-size: 1.05rem; }

/* ============ terms ============ */
.terms { max-width: 38rem; }
.terms h2 { margin-top: 2.2rem; font-size: 1.3rem; }
.terms ul { padding-left: 1.3rem; }
.terms li { margin-bottom: .55rem; }
.stoplist { font-weight: 700; }
.level-note { color: var(--ink-2); font-size: .88rem; }
