:root {
  --paper: #f4efe4;
  --ink: #1c1915;
  --rule: #d9d0c1;
  --hold: #8c3a2f;
  --button: #243026;
  --card: #fffdf8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.2rem/1.45 Georgia, "Iowan Old Style", Palatino, serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 0.4rem; }
h2 { font-size: 1.4rem; margin: 1.6rem 0 0.4rem; }
.top {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--rule);
}
.brand { font-weight: 700; text-decoration: none; }
.top span { flex: 1; }
.wrap { max-width: 42rem; margin: 0 auto; padding: 1.2rem 1rem 6rem; }
body.wide .wrap { max-width: none; }
.narrow { padding-top: 3rem; }
.lede { font-size: 1.35rem; }
.hint { color: #5c564c; font-size: 1rem; }
.msg {
  background: #f6e4dc;
  border-left: 4px solid var(--hold);
  padding: 0.7rem 0.8rem;
}
.note { font-size: 1rem; }
.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.stack.tight { margin-top: 0.6rem; }
label { display: flex; flex-direction: column; gap: 0.3rem; }
label.check { flex-direction: row; align-items: center; gap: 0.6rem; }
input, select, textarea {
  background: var(--card);
  border: 1px solid #b7ad9e;
  border-radius: 0.4rem;
  padding: 0.55rem 0.6rem;
  min-height: 3rem;
}
textarea { min-height: 6rem; }
.button, button.button {
  display: inline-block;
  background: var(--button);
  color: #f4efe4;
  border: 0;
  border-radius: 0.7rem;
  padding: 0.8rem 1.1rem;
  min-height: 3.2rem;
  text-decoration: none;
  cursor: pointer;
}
.button.big { font-size: 1.45rem; padding: 1rem 1.2rem; }
.button.secondary { background: #3d4a40; }
.button.danger { background: var(--hold); }
.quiet, .quiet-link {
  background: transparent;
  border: 0;
  color: #3d4a40;
  text-decoration: underline;
  cursor: pointer;
  min-height: 2.5rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.library { list-style: none; padding: 0; }
.library li { border-top: 1px solid var(--rule); padding: 0.9rem 0; }
.library a { display: block; text-decoration: none; font-size: 1.3rem; }
.color-row { display: flex; gap: 0.4rem; margin-bottom: 0.4rem; }
.color-row input[name="letter"] { max-width: 5rem; }
.color-row input[type="color"] { padding: 0.2rem; width: 3.4rem; }
fieldset { border: 1px solid var(--rule); border-radius: 0.5rem; }
.photo {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  border-top: 1px solid var(--rule);
  padding: 0.9rem 0;
}
.photo img { width: 7rem; height: 7rem; object-fit: cover; background: #ddd; }
.current {
  background: var(--card);
  border: 2px solid var(--ink);
  padding: 1rem;
  margin: 1rem 0;
}
.current p { font-size: 1.7rem; line-height: 1.35; margin: 0.2rem 0 0.8rem; }
.row-label { font-size: 1rem !important; letter-spacing: 0.04em; text-transform: uppercase; }
.note-row, .row-list button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 0.85rem 0.1rem;
  min-height: 3.2rem;
  cursor: pointer;
}
.row-list { list-style: none; padding: 0; margin: 0; }
.row-list button { display: flex; gap: 0.7rem; align-items: baseline; }
.row-list .num { min-width: 2.4rem; font-weight: 700; }
.done-row { color: #6e675c; }
.done-row span:last-child, button.done-row { text-decoration: line-through; }
.is-current { background: #fff7df; }
.legend { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.key {
  display: inline-block;
  min-width: 2rem;
  text-align: center;
  border: 1px solid #b7ad9e;
  padding: 0.15rem 0.35rem;
}
#chart { overflow-x: auto; margin: 1rem 0 5rem; }
.chart-row { display: flex; align-items: center; gap: 0.2rem; margin-bottom: 0.15rem; }
.rowno {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--paper);
  min-width: 4.2rem;
  font-size: 0.95rem;
}
.count { min-width: 2rem; font-size: 0.85rem; color: #5c564c; }
.count.off { color: var(--hold); font-weight: 700; }
.cell {
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid #c8bfb0;
  padding: 0;
  flex: 0 0 auto;
  font-size: 0.72rem;
  cursor: pointer;
}
.cell.unsure { outline: 2px solid var(--hold); background: white; }
.cell.empty { background: #e7e1d6; color: transparent; }
.tiny {
  background: transparent;
  border: 1px solid #b7ad9e;
  border-radius: 0.3rem;
  min-height: 2rem;
  padding: 0 0.35rem;
  cursor: pointer;
}
.savebar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  background: var(--paper);
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
}
