/* The Wesley look (utkwesleyfoundation.org, from packages/ui-wesley): white pages with black text,
   sky blue buttons, a peach curve under the dark bar, Epilogue headings, Poppins text.
   Built for a phone outdoors: large type, strong contrast, big buttons, nothing that moves. */

:root {
  --bg: #ffffff;
  --ink: #000000;
  --muted: #3f4447;
  --line: #d5dadc;
  --panel: #f2f6f7;
  --sky: #89cbe1;
  --sky-ink: #000000;
  --sky-soft: #e3f2f8;
  --peach: #f7af78;
  --peach-soft: #fde7d6;
  --dark: #141414;
  --focus: #0b5f7c;
  --head: "Epilogue", "Helvetica Neue", Arial, sans-serif;
  --body: "Poppins", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101112; --ink: #f5f5f5; --muted: #c3c8cb; --line: #34393c; --panel: #1b1e20;
    --sky-soft: #16313b; --peach-soft: #3a2616; --focus: #89cbe1; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101112; --ink: #f5f5f5; --muted: #c3c8cb; --line: #34393c; --panel: #1b1e20;
  --sky-soft: #16313b; --peach-soft: #3a2616; --focus: #89cbe1; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 1.1875rem; line-height: 1.55;
  min-height: 100dvh; display: flex; flex-direction: column;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
button { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; }
[hidden] { display: none !important; }

/* Dark bar with the logo, the time left, and the theme switch */
.top { background: var(--dark); color: #fff; padding-top: env(safe-area-inset-top, 0px); }
.top-row { max-width: 40rem; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.logo { line-height: 0; }
.logo img { height: 32px; width: auto; }
.clock { margin-left: auto; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; }
.clock.over { color: var(--peach); }
.theme {
  margin-left: auto; width: 44px; height: 44px; border: 1px solid #3a3f42; border-radius: 12px;
  background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer;
}
.clock:not([hidden]) + .theme { margin-left: 0; }
.wave { display: block; width: 100%; height: 22px; background: var(--dark); }
.wave path { fill: var(--peach); }

/* The soft reminder to head back */
.notice {
  max-width: 40rem; width: calc(100% - 32px); margin: 14px auto 0; padding: 12px 14px;
  background: var(--peach-soft); border: 2px solid var(--peach); border-radius: 14px;
  display: flex; align-items: center; gap: 12px; font-weight: 500;
}
.notice span { flex: 1; }

main { flex: 1; width: 100%; max-width: 40rem; margin: 0 auto; padding: 22px 16px 128px; outline: none; }
main.no-bar { padding-bottom: 48px; }

h1, h2, h3 { font-family: var(--head); letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; margin: 0; }
h1 { font-size: 2.6rem; font-weight: 700; }
h2 { font-size: 1.45rem; font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.small { font-size: 1rem; color: var(--muted); }
.small.warn { color: var(--ink); background: var(--peach-soft); border-radius: 10px; padding: 8px 12px; }

/* Start screen */
.subtitle { font-family: var(--head); font-size: 1.6rem; font-weight: 500; margin-top: 4px; }
.credit { font-size: 1rem; color: var(--muted); }
.card { background: var(--panel); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.plan { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; }
.plan dt { font-weight: 500; }
.plan dd { margin: 0; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Buttons */
.btn {
  min-height: 56px; padding: 12px 22px; border-radius: 14px; border: 2px solid transparent; cursor: pointer;
  font-weight: 600; font-size: 1.125rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
}
.btn-primary { background: var(--sky); color: var(--sky-ink); }
.btn-quiet { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-wide { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row .btn { flex: 1 1 auto; }

/* Movement screens */
.steps { display: flex; align-items: center; gap: 12px; font-size: 1rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.steps ol { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex: 1; }
.steps li { height: 6px; flex: 1; border-radius: 3px; background: var(--line); }
.steps li.done { background: var(--sky); }
.steps li.now { background: var(--peach); }
.latin { font-size: 1.05rem; font-style: italic; color: var(--muted); margin-bottom: 2px; }
.timing { font-size: 1rem; color: var(--muted); border-left: 4px solid var(--sky); padding-left: 12px; }
.prompts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.prompts li { padding-left: 20px; position: relative; }
.prompts li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border-radius: 50%; background: var(--peach); }

/* Bottom bar: Back and Next, within reach of a thumb */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
}
.bar-row { max-width: 40rem; margin: 0 auto; display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.bar .btn { min-height: 58px; padding: 10px; }

/* Notes box on each movement screen */
.notes { display: flex; flex-direction: column; gap: 8px; }
.notes label { font-family: var(--head); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; }
.notes textarea {
  width: 100%; min-height: 8.5rem; resize: vertical; padding: 14px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--panel); color: var(--ink); font: inherit; line-height: 1.5;
}
.notes textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: transparent; }

/* Time's-up pop-up */
.popup {
  border: 0; padding: 0; width: calc(100% - 32px); max-width: 26rem; border-radius: 22px;
  background: var(--bg); color: var(--ink); border-top: 8px solid var(--peach);
}
.popup::backdrop { background: rgba(0, 0, 0, 0.6); }
.popup-in { padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 85dvh; overflow-y: auto; }
.popup h2 { font-size: 1.8rem; }

/* Closing screen */
.review { display: flex; flex-direction: column; gap: 16px; }
.review section { border-left: 4px solid var(--peach); padding-left: 14px; }
.review p { white-space: pre-wrap; overflow-wrap: anywhere; }
.questions { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 10px; }
.confirm { background: var(--peach-soft); border: 2px solid var(--peach); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }

@media (min-width: 30rem) { h1 { font-size: 3rem; } }
