:root {
  --ink: #1c2430;
  --paper: #e7eef2;
  --sheet: #f7fafb;
  --brass: #a56b2a;
  --line: #c9d5dc;
  --muted: #526273;
  --danger: #8c3030;
  --danger-bg: #f6dfd8;
  --notice-bg: #f3e6d0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Libre Franklin", "Franklin Gothic Medium", sans-serif;
  font-size: 1rem;
  line-height: 1.45;
}

a { color: var(--ink); }
a:hover { color: var(--brass); }

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

header {
  background: var(--ink);
  color: var(--paper);
  border-top: 4px solid var(--brass);
}

header a { color: var(--paper); text-decoration: none; }
header a:hover { color: #f2d7a4; }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand { font-weight: 700; font-size: 1.15rem; }

.account {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.account form { margin: 0; }

.wrap {
  width: min(52rem, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 3rem;
}

main.wrap { padding-top: 1.4rem; }

h1 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.4rem;
}

h2 { font-size: 1.2rem; margin: 2rem 0 0.6rem; }

.lede { max-width: 62ch; margin-top: 0; }

.meta, .count, .empty { color: var(--muted); }

.notice, .error {
  padding: 0.65rem 0.8rem;
  margin: 0 0 0.8rem;
  max-width: 68ch;
}

.notice { background: var(--notice-bg); }
.error { background: var(--danger-bg); color: var(--danger); }

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem 1rem;
  margin: 1rem 0 0.4rem;
}

.filters { display: flex; gap: 1rem; }
.filters a { text-decoration: none; font-weight: 600; padding-bottom: 0.15rem; }
.filters a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--brass); }

.search { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

input, select, button {
  font: inherit;
  color: var(--ink);
}

input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
select {
  display: block;
  width: 100%;
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 0.5rem 0.6rem;
}

.tools input[type="search"] { width: 16rem; }

button, .quiet {
  background: var(--brass);
  color: var(--ink);
  border: 0;
  padding: 0.55rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

button:disabled { opacity: 0.45; cursor: not-allowed; }

header .quiet {
  background: transparent;
  color: var(--paper);
  font-weight: 600;
  padding: 0;
  text-decoration: underline;
}

.log { margin-top: 0.5rem; }

a.row {
  display: grid;
  gap: 0.1rem;
  padding: 0.85rem 0.2rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

a.row:hover { background: #dce6ec; }
.who { font-weight: 700; }

.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }

.reading { max-width: 44rem; }
.reading h1 { font-size: 2rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin: 1rem 0; }
.actions a { font-weight: 600; }

audio, video { display: block; width: min(100%, 36rem); margin: 0.4rem 0 1rem; }

.cues { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.cues li {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.75rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}
.cues time { color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 0.2rem; }
.speaker { font-weight: 700; }
.cues p {
  font-family: "Source Serif 4", "Iowan Old Style", Palatino, serif;
  font-size: 1.15rem;
  line-height: 1.55;
  margin: 0.15rem 0 0;
  max-width: 62ch;
}

pre.plain {
  font-family: "Source Serif 4", Palatino, serif;
  font-size: 1.1rem;
  line-height: 1.55;
  white-space: pre-wrap;
  max-width: 62ch;
}

form.pull, .sheet form { display: grid; gap: 0.35rem; max-width: 24rem; }
form.pull button, .sheet form button { margin-top: 0.6rem; justify-self: start; }

label { font-weight: 600; margin-top: 0.45rem; }

table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
th, td { text-align: left; vertical-align: top; padding: 0.45rem 0.6rem 0.45rem 0; border-bottom: 1px solid var(--line); }
th { font-weight: 600; }

body.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  padding: 1.5rem;
}

.sheet {
  width: min(100%, 26rem);
  background: var(--paper);
  color: var(--ink);
  border-top: 4px solid var(--brass);
  padding: 1.6rem 1.5rem 1.4rem;
}

.sheet .lede { color: var(--muted); }

code {
  font-family: "Libre Franklin", sans-serif;
  font-size: 0.92rem;
  word-break: break-all;
}

@media (max-width: 40rem) {
  .bar { align-items: flex-start; flex-direction: column; }
  .tools input[type="search"] { width: 100%; }
  .cues li { grid-template-columns: 1fr; gap: 0.15rem; }
  .reading h1 { font-size: 1.55rem; }
}
