/* Class notes: soft and calm. Cream paper, dusty rose and sage by day;
   deep plum by night. Fraunces (with its soft axis) for headings, Nunito
   for text, both served from here, not from a font CDN that some of our
   teachers can't reach. */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/fraunces-latin-full-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/fraunces-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(fonts/nunito-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(fonts/nunito-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg: #faf6f1;
  --bg-rose: #f7e7e6;
  --bg-sage: #e9f0e6;
  --surface: #fffdfa;
  --surface-2: #f6f0ea;
  --ink: #3d3440;
  --muted: #857a82;
  --line: #ebe1d9;
  --accent: #b5687a;
  --accent-hover: #a15a6c;
  --accent-ink: #ffffff;
  --accent-soft: #f7e3e6;
  --sage: #74937a;
  --sage-soft: #e3ede2;
  --warn: #b27a35;
  --warn-soft: #f8ecd8;
  --danger: #b0504b;
  --danger-soft: #f8e1df;
  --petal: #f1c9d0;
  --pollen: #e7b75f;
  --shadow: 0 1px 2px rgb(61 52 64 / 4%), 0 10px 30px rgb(61 52 64 / 7%);
  --focus: 0 0 0 3px rgb(181 104 122 / 35%);

  --serif: "Fraunces", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --sans: "Nunito", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1c181e;
    --bg-rose: #2a1f26;
    --bg-sage: #1d2520;
    --surface: #251f27;
    --surface-2: #2d2630;
    --ink: #eee5ea;
    --muted: #a99ca6;
    --line: #3a3139;
    --accent: #e0a0ae;
    --accent-hover: #ebb3bf;
    --accent-ink: #2a1c22;
    --accent-soft: #3b2931;
    --sage: #9dbaa0;
    --sage-soft: #26332a;
    --warn: #e2b475;
    --warn-soft: #3a2f20;
    --danger: #ea8f88;
    --danger-soft: #3d2426;
    --petal: #6d4553;
    --pollen: #c99b4a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 30px rgb(0 0 0 / 25%);
    --focus: 0 0 0 3px rgb(224 160 174 / 40%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c181e;
  --bg-rose: #2a1f26;
  --bg-sage: #1d2520;
  --surface: #251f27;
  --surface-2: #2d2630;
  --ink: #eee5ea;
  --muted: #a99ca6;
  --line: #3a3139;
  --accent: #e0a0ae;
  --accent-hover: #ebb3bf;
  --accent-ink: #2a1c22;
  --accent-soft: #3b2931;
  --sage: #9dbaa0;
  --sage-soft: #26332a;
  --warn: #e2b475;
  --warn-soft: #3a2f20;
  --danger: #ea8f88;
  --danger-soft: #3d2426;
  --petal: #6d4553;
  --pollen: #c99b4a;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 30px rgb(0 0 0 / 25%);
  --focus: 0 0 0 3px rgb(224 160 174 / 40%);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(60rem 40rem at -10% -10%, var(--bg-rose), transparent 60%),
    radial-gradient(50rem 40rem at 110% 110%, var(--bg-sage), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100, "WONK" 0;
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 0.9rem; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

.hint { color: var(--muted); }
.small { font-size: 0.9rem; }
.problem { color: var(--danger); }

/* The bar along the top: the name, who's signed in, the theme, and
   signing out. */
.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 56rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  font-size: 1.3rem;
  font-weight: 600;
}
.brand:hover { color: var(--ink); }
.sprig { width: 2.1rem; height: 2.1rem; flex: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.who { display: flex; align-items: center; gap: 0.5rem; font-weight: 650; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--serif);
  font-weight: 650;
}
.top form { margin: 0; }

/* The language menu. */
.lang { display: flex; align-items: center; gap: 0.3rem; margin: 0; color: var(--muted); }
.lang svg { width: 1rem; height: 1rem; }
.lang select {
  font: inherit; font-size: 0.9rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.7rem; cursor: pointer;
}
.lang select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }

/* Light, dark, or as the device is. */
.theme {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.theme button {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 1.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.theme svg { width: 1rem; height: 1rem; }

main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 4rem;
  position: relative;
  z-index: 1;
}

.dev {
  max-width: 56rem;
  margin: 0 auto 0.5rem;
  padding: 0 1.25rem;
  font-size: 0.85rem;
  color: var(--warn);
}
.dev span {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border: 1px dashed var(--warn);
  border-radius: 999px;
  background: var(--warn-soft);
}

.greeting { margin: 1.5rem 0 1.75rem; }
.greeting h1 { margin-bottom: 0.25rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card > h2 { display: flex; align-items: center; gap: 0.5rem; }
.card-lead { color: var(--muted); margin-top: -0.25rem; }
.card h3 { margin-top: 1.25rem; }

.center { text-align: center; }

/* Adding a board, folded away for someone who only learns. */
details.more { box-shadow: none; background: transparent; border-style: dashed; padding: 1rem 1.5rem; }
details.more summary { color: var(--accent); font-weight: 700; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; display: inline-block; width: 1.2rem; font-weight: 800; }
details.more[open] summary::before { content: "−"; }
details.more[open] { background: var(--surface); box-shadow: var(--shadow); border-style: solid; }
.welcome { max-width: 34rem; margin: 3rem auto; padding: 2.5rem 2rem; }
.welcome .sprig { width: 4rem; height: 4rem; margin-bottom: 0.5rem; }

/* Buttons: soft pills. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.button.quiet { background: transparent; color: var(--accent); }
.button.quiet:hover { background: var(--accent-soft); color: var(--accent); }
.button.small { padding: 0.35rem 0.85rem; font-size: 0.875rem; }
.button.big { padding: 0.8rem 1.6rem; font-size: 1.05rem; }
.button svg { width: 1em; height: 1em; flex: none; }
.button.copied { background: var(--sage); border-color: var(--sage); color: var(--accent-ink); }

/* Lists of boards: a row each. */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.75fr);
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.9rem 0.75rem;
  margin: 0 -0.75rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 2rem;
}
.row.head {
  border-top: 0;
  padding-top: 0;
  padding-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.row:target { background: var(--accent-soft); border-radius: 12px; animation: settle 2.5s ease-out 1s forwards; }
@keyframes settle { to { background: transparent; } }
.row.mine { grid-template-columns: minmax(0, 1fr) auto; }
.board-name {
  font-family: var(--serif);
  font-variation-settings: "SOFT" 100;
  font-weight: 560;
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}
.status { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.status .detail { color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.label { display: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.12rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
}
.pill::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.pill.active { background: var(--sage-soft); color: var(--sage); }
.pill.idle { background: var(--warn-soft); color: var(--warn); }
.pill.failing { background: var(--danger-soft); color: var(--danger); }
.pill.joined, .pill.syncing { background: var(--accent-soft); color: var(--accent); }
.pill.syncing::before { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.25; } }

.empty { color: var(--muted); font-style: italic; }
.row[hidden] { display: none; }

/* Where a student is, and their time now. */
.place { display: flex; align-items: flex-start; gap: 0.3rem; color: var(--muted); font-size: 0.85rem; line-height: 1.4; margin-top: 0.15rem; }
.place svg { width: 0.85rem; height: 0.85rem; flex: none; margin-top: 0.15rem; }
.nowrap { white-space: nowrap; }

/* Finding and sorting the students. */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 0.5rem 0 1rem; }
.filter, .sort select {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
}
.filter { flex: 1 1 14rem; min-width: 0; }
.filter:focus, .sort select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.sort { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0 auto; }
.sort label { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.sort select { padding-right: 2rem; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.05rem) 55%, calc(100% - 0.75rem) 55%;
  background-size: 0.3rem 0.3rem;
  background-repeat: no-repeat; }

/* Adding a board: the one place a Miro link goes. */
.add-form { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.4rem 0 0.5rem; }
.field {
  flex: 1 1 18rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
}
.field:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.field svg { width: 1.1rem; height: 1.1rem; flex: none; }
.field input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  outline: none;
}
.field input::placeholder { color: var(--muted); opacity: 0.8; }
.field-label { display: block; font-weight: 700; margin-top: 1.5rem; }

.notice {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  margin: 0.75rem 0;
}

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0.75rem 0 0; }
.steps li { counter-increment: step; position: relative; padding-left: 2.2rem; margin-bottom: 0.4rem; color: var(--muted); }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--sage-soft);
  color: var(--sage);
}

/* A sync under way: a gentle bar, not a spinner. */
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin: 1rem 0;
}
.progress span {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--petal), var(--accent));
  animation: drift 2.4s ease-in-out infinite;
}
@keyframes drift { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

.found { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.5rem; }
.found li { display: flex; align-items: baseline; gap: 0.6rem; }
.found b { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--accent); min-width: 3ch; text-align: right; }

details summary { cursor: pointer; }
pre { white-space: pre-wrap; font-size: 0.85rem; background: var(--surface-2); padding: 0.75rem; border-radius: 10px; }

/* A board's notes. */
.crumb { margin-bottom: 0.5rem; font-size: 0.9rem; }
.crumb a { text-decoration: none; }
.notes-bar { margin: -0.75rem 0 1.25rem; }
.notes-bar p { margin-bottom: 0.3rem; }
.day { padding: 1.25rem 1.5rem 1.5rem; scroll-margin-top: 1rem; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.day-head h2 { margin: 0; font-size: 1.25rem; }
/* The notes on paper, in both themes: her colours are meant for white,
   and a pink word or a yellow phrase says something. */
.paper {
  background: #fffdf8;
  color: #2f2932;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  font-size: 1rem;
  line-height: 1.65;
}
.paper h3 {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #8b7f88;
  margin: 1rem 0 0.25rem;
}
.paper h3:first-child { margin-top: 0; }
.paper .note p { margin: 0 0 0.35rem; }
.paper .note ul, .paper .note ol { margin: 0.2rem 0 0.4rem; padding-left: 1.4rem; }
.paper a { color: #a15a6c; }
.paper .also { color: #8b7f88; font-style: italic; font-size: 0.9rem; margin: 0.9rem 0 0; }

.row-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.board-name a { color: inherit; text-decoration: none; }
.board-name a:hover { color: var(--accent); }
.notes-link { font-size: 0.9rem; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 0.3rem; }
.notes-link svg { width: 0.95rem; height: 0.95rem; }

.row-links { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; align-items: center; margin-top: 0.2rem; }
.remove-link { font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.remove-link:hover { color: var(--danger); }
.button.danger { background: var(--danger); border-color: var(--danger); }
.button.danger:hover { background: var(--danger); border-color: var(--danger); filter: brightness(0.92); }
.consequences { padding-left: 1.2rem; color: var(--muted); }
.consequences li { margin-bottom: 0.4rem; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.25rem; }

/* Downloading notes. */
details.download summary { display: flex; align-items: center; gap: 0.4rem; }
details.download summary svg { width: 1.05rem; height: 1.05rem; }
details.download summary::before { display: none; }
.download-form { margin-top: 1rem; }
.field-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; }
.field-row label, .paper-choice { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.download-form input[type="date"], .paper-choice select {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.8rem;
}
.choices { border: 0; padding: 0; margin: 1rem 0; display: grid; gap: 0.35rem; }
.choices legend { font-weight: 700; margin-bottom: 0.35rem; }
.choices label { display: flex; align-items: center; gap: 0.5rem; }
.choices input { accent-color: var(--accent); }
.paper-choice { margin-bottom: 1rem; }

/* The index of days: a long, quiet list. */
.index { padding: 0.75rem 1.5rem 1.25rem; }
.year-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem;
  margin: 1rem 0 0.25rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.month-jump { display: flex; flex-wrap: wrap; gap: 0.2rem 0.7rem; font-family: var(--sans); font-size: 0.85rem; font-weight: 600; }
.month-jump a { text-decoration: none; color: var(--muted); }
.month-jump a:hover { color: var(--accent); }
.month {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--sage); margin: 1.1rem 0 0.2rem; scroll-margin-top: 3.5rem;
}
.days { list-style: none; margin: 0; padding: 0; }
.day-row {
  display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) 1.8rem; gap: 0.25rem; align-items: center;
  margin: 0 -0.6rem; padding: 0 0.3rem; border-radius: 10px;
}
.day-row:hover { background: var(--accent-soft); }
.day-link {
  display: grid; grid-template-columns: 5.2rem minmax(0, 1fr) auto auto; gap: 0.75rem; align-items: baseline;
  padding: 0.5rem 0.3rem; color: var(--ink); text-decoration: none; min-width: 0;
}
.day-link:hover { color: var(--ink); }

/* Stars and tags: what the student keeps about a day. */
.star-form { margin: 0; display: flex; }
.star {
  display: grid; place-items: center; width: 1.6rem; height: 1.6rem; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--line); cursor: pointer;
}
.star svg { width: 1.05rem; height: 1.05rem; fill: none; }
.day-row:hover .star { color: var(--muted); }
.star[aria-pressed="true"], .day-row.starred .star, .star.static { color: var(--pollen); }
.star[aria-pressed="true"] svg, .day-row.starred .star svg, .star.static svg { fill: var(--pollen); }
.star.static { display: inline-grid; place-items: center; width: 1.6rem; }
.star.static svg { width: 1rem; height: 1rem; }
.button.starred { color: var(--warn); border-color: var(--pollen); }
.button.starred svg, .button.starred:hover svg { fill: var(--pollen); color: var(--pollen); }
.edit {
  display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  color: var(--muted); opacity: 0; transition: opacity 0.15s;
}
.edit svg { width: 0.95rem; height: 0.95rem; }
.day-row:hover .edit, .edit:focus-visible { opacity: 1; }
.edit:hover { color: var(--accent); background: var(--surface); }
@media (hover: none) { .edit { opacity: 0.6; } }
.tags { display: flex; gap: 0.3rem; flex-wrap: nowrap; overflow: hidden; max-width: 14rem; }
.tag {
  font-size: 0.75rem; font-weight: 700; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 0.05rem 0.5rem; white-space: nowrap;
}
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0 0.25rem; }
.chip {
  font-size: 0.85rem; font-weight: 700; text-decoration: none; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.75rem; background: var(--bg);
}
.chip .n { font-weight: 600; opacity: 0.7; margin-left: 0.15rem; }
.chip:hover { color: var(--accent); border-color: var(--accent); }
.chip.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.star-chip:not(.on) { color: var(--warn); }
.filter-note { margin: 0.4rem 0 0; }
.mark-editor {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.25rem 0.3rem 0.75rem 2rem;
}
.mark-editor input, .marks-grid input {
  font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.35rem 0.85rem; min-width: 0;
}
.mark-editor input { flex: 1 1 12rem; }
.mark-editor input:focus, .marks-grid input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.marks-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.5rem 0.9rem; align-items: center; }
.marks-grid label { font-weight: 700; }
.label-actions { margin: 0.6rem 0 0; }
.label-card .star-form.big { margin-top: 0.6rem; }
.label-card p .tag { margin-left: 0.25rem; }
.hits h2 .tag { font-family: var(--sans); }
.when { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.what { min-width: 0; display: flex; gap: 0.6rem; align-items: baseline; }
.lessons { flex: none; font-size: 0.78rem; font-weight: 700; color: var(--sage); background: var(--sage-soft); border-radius: 999px; padding: 0.05rem 0.55rem; white-space: nowrap; }
.gist { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gist.dim { color: var(--muted); font-size: 0.9rem; }
.label-text { font-family: var(--serif); font-variation-settings: "SOFT" 100; font-weight: 600; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.what .label-text { flex: 0 1 auto; max-width: 60%; }
.what .gist { flex: 1 1 0; min-width: 4rem; }
.count { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

/* A day's own page. */
.day-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 1.25rem; flex-wrap: wrap; }
.label-card { padding: 1rem 1.5rem; }
.label-card p { margin: 0; }
.label-form label { font-weight: 700; display: block; margin-bottom: 0.35rem; }
.label-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.label-row input {
  flex: 1 1 16rem; min-width: 0; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.9rem;
}
.label-row input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.label-form .hint { margin-top: 0.4rem; }
.paper h3:target { background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 0.1rem 0.4rem; margin-left: -0.4rem; }
.paper h3 { scroll-margin-top: 1.5rem; }

/* Search. */
.search-box {
  display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem;
  padding: 0.3rem 0.35rem 0.3rem 0.9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  box-shadow: var(--shadow);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.search-box svg { width: 1.1rem; height: 1.1rem; color: var(--muted); flex: none; }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); outline: none; padding: 0.35rem 0; }
.hits h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem; font-size: 1.15rem; }
.hits h2 a { color: inherit; text-decoration: none; }
.hits h2 a:hover { color: var(--accent); }
.hits .label-text { font-size: 0.95rem; }
.hit { display: block; padding: 0.55rem 0.7rem; margin: 0 -0.7rem; border-radius: 10px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line); }
.hit:hover { background: var(--accent-soft); color: var(--ink); }
.hit-line { display: block; overflow-wrap: anywhere; }
mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 0.1rem; box-shadow: 0 0 0 1px var(--warn) inset; }
.label-text.label-hit { background: var(--warn-soft); border-radius: 4px; padding: 0 0.3rem; box-shadow: 0 0 0 1px var(--warn) inset; }

@media (max-width: 40rem) {
  .day-link { grid-template-columns: 4rem minmax(0, 1fr) auto; gap: 0.5rem; }
  .day-link .tags { grid-column: 2; grid-row: 2; max-width: 100%; flex-wrap: wrap; }
  .marks-grid { grid-template-columns: 1fr; }
  .mark-editor { padding-left: 0.3rem; }
  .what { flex-direction: column; align-items: stretch; gap: 0.1rem; }
  .what > * { max-width: 100%; }
  .what .label-text, .what .gist { flex: none; max-width: 100%; }
  .lessons { align-self: flex-start; }
  .index { padding: 0.5rem 1rem 1rem; }
}

.board-stats { display: flex; flex-wrap: wrap; gap: 0 0.5rem; font-size: 0.85rem; color: var(--ink); margin: 0.1rem 0 0.2rem; }
.board-stats span + span::before { content: "·"; margin-right: 0.5rem; color: var(--muted); }

/* Guidance on a centred page reads better aligned left. */
.guide { text-align: left; margin: 1.5rem 0 1rem; }
.guide h2 { font-size: 1.1rem; margin: 1.25rem 0 0.4rem; }
.guide .steps li { color: var(--ink); }

/* A branch in the corner, barely there. */
.bloom {
  position: fixed;
  right: -2rem;
  bottom: -2rem;
  width: 22rem;
  height: 22rem;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 0 1rem 2rem; position: relative; z-index: 1; }

@media (max-width: 40rem) {
  body { font-size: 16px; }
  .top { flex-wrap: wrap; gap: 0.5rem; }
  .who .name { display: none; }
  .card { padding: 1.15rem; }
  .row, .row.mine { grid-template-columns: 1fr; }
  .row.head { display: none; }
  .label { display: inline; color: var(--muted); font-size: 0.85rem; }
  .bloom { width: 14rem; height: 14rem; opacity: 0.25; }
}

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