:root {
  --bg: #f6efe4;
  --card: #fffaf2;
  --ink: #2a211b;
  --soft: #6b5b4e;
  --line: #e6d9c6;
  --accent: #c2562b;
  --accent-soft: #f7dfd2;
  --goal: #2f6b5a;
  --goal-soft: #dcefe8;
  --span: #efe3cf;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1714;
    --card: #26201b;
    --ink: #f4ece1;
    --soft: #b8a896;
    --line: #3a312a;
    --accent: #f08a5d;
    --accent-soft: #43281c;
    --goal: #8fd3bd;
    --goal-soft: #1f3a32;
    --span: #3a2f24;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 19px/1.45 var(--sans);
}
main {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) 16px calc(env(safe-area-inset-bottom) + 40px);
}

.day {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  text-align: center;
  margin-bottom: 8px;
}
.eyebrow {
  margin: 0;
  font-size: 15px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
h1 {
  margin: 2px 0 0;
  font: 600 34px/1.15 var(--serif);
}
.nav {
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--soft);
  font-size: 30px;
  cursor: pointer;
}
.nav:hover, .nav:focus-visible { background: var(--card); color: var(--ink); }
.nav:focus-visible { outline: 2px solid var(--accent); }

section { margin-top: 28px; }
h2 {
  margin: 0 0 10px;
  font: 600 14px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--soft);
}

.calendar { list-style: none; margin: 0; padding: 0; }
.calendar li {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.calendar li:last-child { border-bottom: 0; }
.calendar .time {
  flex: 0 0 auto;
  min-width: 6.2em;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}
.calendar .span {
  display: block;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--span);
  font-size: 16px;
  margin-bottom: 6px;
}
.calendar a { color: inherit; }
.calendar .open-day { color: var(--soft); border: 0; }

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(60, 40, 20, .06);
}
.finish .card { border-left: 5px solid var(--accent); }

.three { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: n; }
.three li { counter-increment: n; position: relative; }
.three .card { padding-left: 64px; }
.three li::before {
  content: counter(n);
  position: absolute; left: 16px; top: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font: 700 18px/1 var(--serif);
  z-index: 1; /* above the card, which rises in with a transform */
}
.name {
  margin: 0;
  font: 600 22px/1.25 var(--serif);
}
.code { color: var(--soft); font: 500 16px var(--sans); white-space: nowrap; }
.goal {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--goal-soft);
  color: var(--goal);
  font-size: 15px;
  font-weight: 600;
}
.why { margin: 8px 0 0; color: var(--soft); font-size: 17px; }
/* The morning screen (A6): a pick can be ticked where it stands. */
.card .pick-head { display: flex; gap: 12px; align-items: flex-start; }
.card .pick-head input { width: 22px; height: 22px; margin: 4px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.card.done .name { color: var(--soft); text-decoration: line-through; }
/* The Goal from My Life (A8), linked, in the pill's own colour. */
.goal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.goal.unnamed { background: transparent; color: var(--soft); font-weight: 500; padding-left: 0; }
.week-goals { list-style: none; margin: 0; padding: 0; }
.week-goals li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }
.week-goals li:last-child { border-bottom: 0; }
.week-goals .when { color: var(--soft); min-width: 4.5em; }
.week-goals .done { color: var(--soft); text-decoration: line-through; }
.note { margin: 14px 2px 0; color: var(--soft); font-size: 15px; }
.empty { color: var(--soft); }

@media (min-width: 700px) {
  body { font-size: 18px; }
  h1 { font-size: 40px; }
}
@media (prefers-reduced-motion: no-preference) {
  .card { animation: rise .35s ease-out both; }
  .three li:nth-child(2) .card { animation-delay: .06s; }
  .three li:nth-child(3) .card { animation-delay: .12s; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
}

/* A quote, e.g. the assistant quoting a note (B9). */
blockquote { margin: 0.6em 0; padding: 0.1em 0 0.1em 0.9em; border-left: 3px solid var(--line); color: var(--soft); }
/* A link to one of her pages in the assistant's answer (B9). */
a.pagelink { color: var(--accent); font-weight: 600; }

/* Dictate (B15): pressed while it listens. */
button.link[aria-pressed="true"] { color: var(--accent); font-weight: 700; }

/* The keys (?), after A6: a small panel listing this page's keys. */
.keys-box { border: 0; border-radius: 16px; padding: 18px 20px; width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--bg); color: var(--ink); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.keys-box::backdrop { background: rgba(0, 0, 0, .3); }
.keys-head { display: flex; align-items: baseline; justify-content: space-between; }
.keys-head h2 { margin: 0; font: 600 22px/1.2 var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink); }
.keys-box h3 { margin: 14px 0 6px; font: 600 13px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.keys-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 15px; }
.keys-box dt { margin: 0; }
.keys-box dd { margin: 0; color: var(--ink); }
.keys-box kbd { display: inline-block; min-width: 1.6em; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); font: 600 13px/1.5 var(--sans); text-align: center; }

/* Inner or Outer World (A2): two small buttons under the words, and a
   pasted link's card. A circle is Inner, a square Outer, everywhere. */
.world-row { display: flex; gap: 8px; margin: 4px 0 2px; }
.world {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 36px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: none; color: var(--soft); font: 500 14px/1 var(--sans); cursor: pointer;
}
.world[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.world:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.world-mark { display: inline-block; width: 10px; height: 10px; border: 2px solid currentColor; flex: none; }
.world-mark.inner { border-radius: 50%; }
.world-mark.outer { border-radius: 2px; }
.link-card {
  display: flex; flex-direction: column; gap: 2px; margin: 8px 0 0; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 12px; font-size: 14px; overflow-wrap: anywhere;
}
.link-card[hidden] { display: none; }
.link-card .link-title { font-weight: 600; color: var(--ink); }
.link-card .link-host { color: var(--soft); }
.cap-world.world-row { margin: 10px 0 0; }
.cap-world .world { min-height: 44px; padding: 6px 16px; font-size: 16px; }
