:root {
  --cream: #faf6ee;
  --amber: #d99a4e;
  --amber-deep: #b97a2f;
  --sage: #7d8f6f;
  --sage-deep: #5c6e52;
  --ink: #3d3428;
  --ink-soft: #6b5f4c;
  --card: #fffdf8;
  --line: #eadfc8;
  --serif: "Cormorant Garamond", Georgia, serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
/* slim sticky app bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: .55rem 1rem;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.topbar .home-link { justify-self: start; color: var(--sage-deep); text-decoration: none; font-size: .85rem; font-weight: 600; }
.topbar .home-link:hover { text-decoration: underline; }
.topbar .app-title { display: flex; align-items: center; gap: .6rem; }
.topbar .logo { width: 30px; height: 30px; border-radius: 8px; }
.topbar h1 { font-size: 1.05rem; letter-spacing: .06em; color: var(--sage-deep); font-weight: 700; }
.topbar .topbar-spacer { justify-self: end; }
main { flex: 1; max-width: 680px; width: 100%; margin: 0 auto; padding: 1.2rem 1rem calc(3rem + env(safe-area-inset-bottom)); }
section { margin-bottom: 1.4rem; }
section h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: .06em;
  color: var(--sage-deep);
  margin-bottom: .6rem;
}
.divider { border: none; border-top: 1px solid var(--line); margin: 1.4rem 0; }
.empty { color: #a2937a; font-style: italic; padding: .4rem .2rem; font-size: .95rem; }
/* words of the week */
.words-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 12px;
  padding: .9rem 1rem;
  margin-bottom: .8rem;
}
.words-card .week-label { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: #a2937a; margin-bottom: .4rem; }
.words-card .chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: .5rem 0; }
.words-card .chip {
  background: #f6efdd;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .8rem;
  font-size: 1rem; font-weight: 600;
  color: var(--ink);
}
.words-card .note { font-size: .88rem; color: var(--ink-soft); }
/* expandable cards */
.cards { display: flex; flex-direction: column; gap: .55rem; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.card-head {
  width: 100%;
  display: flex; align-items: center; gap: .7rem;
  background: none; border: none;
  padding: .75rem .9rem;
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  color: var(--ink);
}
.date-badge {
  flex-shrink: 0;
  min-width: 3.2rem;
  text-align: center;
  background: var(--sage-deep);
  color: #fff;
  border-radius: 8px;
  padding: .25rem .4rem;
  font-size: .78rem; font-weight: 700;
  line-height: 1.25;
}
.date-badge.past { background: #b7a888; }
.date-badge .dow { display: block; font-weight: 600; font-size: .68rem; opacity: .85; }
.card-title { flex: 1; font-weight: 600; }
.card-head .chev { color: #b7a888; font-size: 1.2rem; transition: transform .18s ease; flex-shrink: 0; }
.card.open .card-head .chev { transform: rotate(90deg); }
.card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.card.open .card-body { max-height: 40rem; }
.card-body-inner { padding: 0 .9rem .9rem 4.6rem; font-size: .93rem; color: var(--ink-soft); }
.card-body-inner p + p { margin-top: .5rem; }
.card-body-inner .due { font-weight: 700; color: var(--amber-deep); }
.card-body-inner .source { font-size: .8rem; color: #a2937a; font-style: italic; margin-top: .6rem; }
.updated { text-align: center; color: #a2937a; font-size: .8rem; margin-top: 1.6rem; }
@media (max-width: 480px) {
  .card-body-inner { padding-left: .9rem; }
}
