/* Calque. One sheet of paper: stock, ink, and a few pigments.
   Nothing is rounded, nothing glows, nothing fades. The mode line is the one
   solid block of ink on the page, and a selection prints negative. */

@font-face { font-family: "Garamond"; font-style: normal; font-weight: 400 800;
  font-display: swap; src: url(/static/fonts/garamond.woff2) format("woff2"); }
@font-face { font-family: "Garamond"; font-style: italic; font-weight: 400 800;
  font-display: swap;
  src: url(/static/fonts/garamond-italic.woff2) format("woff2"); }
@font-face { font-family: "Kirsch"; font-display: block;
  src: url(/static/fonts/kirsch.woff2) format("woff2"); }

:root {
  --paper: #f8f1de; --paper2: #efe5c9; --paper3: #e4d7b4; --card: #fbf6e8;
  --sep: #e8dcbe; --rule: #d0c1a0;
  --ink: #33261a; --ink2: #5a4a34; --ink3: #92815f;
  --russet: #a8431f; --gold: #c08a2e; --moss: #5f7245; --sky: #35566b;
  --verdigris: #4a7068; --berry: #7d4a58;

  --text: "Garamond", "EB Garamond", "Iowan Old Style", "Palatino Linotype",
    Georgia, serif;
  --pixel: "Kirsch", ui-monospace, "Cascadia Mono", monospace;

  --size: 21px;
  --measure: 34em;
  --mode: 32px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --view: 100dvh;
  --keyboard: 0px;
  color-scheme: light;
}

:root[data-theme="night"] {
  --paper: #1c150e; --paper2: #241c12; --paper3: #2e2517; --card: #2a2115;
  --sep: #443726; --rule: #55452e;
  --ink: #f6efdb; --ink2: #dccfb2; --ink3: #a8987a;
  --russet: #cb4a26; --gold: #c99a3c; --moss: #7f9660; --sky: #7a9cbd;
  --verdigris: #6d9690; --berry: #ab7f8c;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="paper"]) {
    --paper: #1c150e; --paper2: #241c12; --paper3: #2e2517; --card: #2a2115;
    --sep: #443726; --rule: #55452e;
    --ink: #f6efdb; --ink2: #dccfb2; --ink3: #a8987a;
    --russet: #cb4a26; --gold: #c99a3c; --moss: #7f9660; --sky: #7a9cbd;
    --verdigris: #6d9690; --berry: #ab7f8c;
    color-scheme: dark;
  }
}

/* E-ink: black on white, nothing that needs colour or motion to be read. */
:root[data-theme="eink"] {
  --paper: #ffffff; --paper2: #ffffff; --paper3: #eeeeee; --card: #ffffff;
  --sep: #bbbbbb; --rule: #777777;
  --ink: #000000; --ink2: #000000; --ink3: #444444;
  --russet: #000000; --gold: #000000; --moss: #000000; --sky: #000000;
  --verdigris: #000000; --berry: #000000;
  color-scheme: light;
}
:root[data-theme="eink"] *, :root[data-theme="eink"] *::before {
  transition: none !important; animation: none !important;
  scroll-behavior: auto !important; }
:root[data-theme="eink"] #mode .seg.hot { background: var(--paper);
  color: var(--ink); }
:root[data-theme="eink"] #tr .src .w.ok { background: none;
  text-decoration: underline solid var(--ink); text-underline-offset: 5px; }
:root[data-theme="eink"] #tr .src .w.miss { background: none;
  font-weight: 600; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-family: var(--text); font-size: 19px; line-height: 1.45;
  font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-tap-highlight-color: transparent; min-height: var(--view);
  padding-bottom: calc(var(--mode) + var(--safe-bottom)); }
::selection { background: var(--ink); color: var(--paper); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--russet); outline-offset: 2px; }

.sc { font-variant-caps: all-small-caps; letter-spacing: .08em; }
/* Ligatures fire before small caps and leave a lowercase «f» in «KAFKA». */
.sc, .act, .block, label.k, #talk .send, #talk .bar .title, h2.sect, .masthead h1, #mode .title, .book .author,
#text h3, #text .titlepage .author, #note .pos, .deck .src, .deck .grades button,
#sheet h4, .prefs > .k, table.words tr.lang td, #chip, #drop {
  font-variant-ligatures: none; }
.px { font-family: var(--pixel); font-size: 16px; line-height: 1;
  font-variant-numeric: normal; font-variant-caps: normal; letter-spacing: 0;
  text-transform: none; }
.muted { color: var(--ink3); }

/* ------------------------------------------------------------ buttons */

.act { background: none; border: 0; padding: 6px 0; cursor: pointer;
  font-variant-caps: all-small-caps; letter-spacing: .08em; font-size: 19px;
  color: var(--ink2); border-bottom: 1px solid transparent; }
.act:hover { color: var(--ink); border-bottom-color: var(--ink); }
.act[disabled] { color: var(--ink3); cursor: default; border-color: transparent; }
.act.on { color: var(--russet); }
.block { background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  padding: 8px 18px; cursor: pointer; font-variant-caps: all-small-caps;
  letter-spacing: .1em; font-size: 19px; }
.block:hover { background: var(--russet); border-color: var(--russet); }
.block[disabled] { background: var(--ink3); border-color: var(--ink3); cursor: wait; }
.field { display: block; width: 100%; background: transparent; border: 0;
  border-bottom: 1px solid var(--rule); padding: 8px 0; font-size: 21px;
  border-radius: 0; outline: none; }
.field:focus { border-bottom-color: var(--ink); }
label.k { display: block; color: var(--ink3); margin-top: 22px;
  font-variant-caps: all-small-caps; letter-spacing: .08em; }

/* ---------------------------------------------------------- mode line */

#mode { position: fixed; left: 0; right: 0; bottom: var(--keyboard); z-index: 40;
  background: var(--ink); color: var(--paper);
  height: calc(var(--mode) + var(--safe-bottom));
  padding: 0 6px var(--safe-bottom); display: flex; align-items: stretch;
  font-family: var(--pixel); font-size: 16px; line-height: var(--mode);
  white-space: nowrap; overflow: hidden; user-select: none;
  -webkit-user-select: none; }
#mode .seg { padding: 0 8px; display: flex; align-items: center; gap: 6px;
  color: inherit; text-decoration: none; background: none; border: 0;
  font: inherit; cursor: default; flex: none; }
#mode button.seg, #mode a.seg { cursor: pointer; }
#mode button.seg:hover, #mode a.seg:hover { background: var(--ink2); }
#mode .seg.hot { background: var(--russet); }
#mode .seg.dim { color: var(--ink3); }
#mode .grow { flex: 1 1 auto; min-width: 0; overflow: hidden; }
#mode .grow > span { overflow: hidden; text-overflow: ellipsis; }
#mode .title { font-family: var(--text); font-size: 17px;
  font-variant-caps: all-small-caps; letter-spacing: .08em; }
#mode .bar { width: 56px; height: 4px; background: var(--ink2);
  position: relative; }
#mode .bar i { position: absolute; inset: 0 auto 0 0; background: var(--paper); }
@media (max-width: 560px) { #mode .wide { display: none; } }

/* ---------------------------------------------------------- pages */

.page { max-width: 46rem; margin: 0 auto; padding: 48px 22px 64px; }
.masthead { text-align: center; margin: 24px 0 40px; }
.masthead h1 { font-weight: 400; font-size: 46px; margin: 0;
  font-variant-caps: all-small-caps; letter-spacing: .22em;
  padding-left: .22em; line-height: 1; }
.masthead .rule { margin: 14px auto 0; width: 96px; border-top: 1px solid var(--ink); }
h2.sect { font-weight: 400; font-size: 19px; margin: 40px 0 0; color: var(--ink2);
  font-variant-caps: all-small-caps; letter-spacing: .12em;
  display: flex; gap: 12px; align-items: baseline;
  border-bottom: 1px solid var(--ink); padding-bottom: 4px; }
h2.sect .px { margin-left: auto; color: var(--ink3); }

/* ---------------------------------------------------------- library */

.langs { display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center;
  margin: -16px 0 8px; }
.langs button { background: none; border: 0; padding: 4px 0; cursor: pointer;
  color: var(--ink3); font-size: 19px; border-bottom: 1px solid transparent; }
.langs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.shelf { list-style: none; margin: 0; padding: 0; }
.book { display: grid; grid-template-columns: 1fr auto; gap: 0 16px;
  padding: 12px 0 11px; border-bottom: 1px solid var(--sep); cursor: pointer;
  position: relative; }
.book:hover .title { text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 4px; }
.book .author { color: var(--ink2); font-variant-caps: all-small-caps;
  letter-spacing: .08em; font-size: 18px; }
.book .title { font-style: italic; font-size: 22px; line-height: 1.2; }
.book .sub { color: var(--ink2); font-size: 17px; margin-top: 2px; }
.book .meta { grid-column: 2; grid-row: 1 / span 2; text-align: right;
  align-self: center; display: flex; flex-direction: column; gap: 6px;
  align-items: flex-end; color: var(--ink3); }
.book .meta .pct { color: var(--ink); }
.book .read { grid-column: 1 / -1; height: 2px; margin-top: 8px;
  background: var(--sep); position: relative; }
.book .read i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.book .read b { position: absolute; top: -2px; width: 2px; height: 6px;
  background: var(--moss); }
.book .own { color: var(--russet); }
.book .edit { position: absolute; right: -40px; top: 6px; width: 36px; height: 36px;
  background: none; border: 0; color: var(--rule); cursor: pointer;
  font-family: var(--pixel); font-size: 16px; }
.book:hover .edit { color: var(--ink3); }
.book .edit:hover { color: var(--ink); }
@media (max-width: 860px) { .book { padding-right: 34px; }
  .book .edit { right: -8px; top: 50%; transform: translateY(-50%); } }
.book.pick { cursor: default; }
.bookedit { grid-column: 1 / -1; display: grid; gap: 0 20px;
  grid-template-columns: 1fr 1fr 6em; margin-top: 8px; cursor: default; }
.bookedit .row { grid-column: 1 / -1; display: flex; gap: 22px; margin-top: 12px;
  align-items: baseline; }
.bookedit .row .danger { margin-left: auto; color: var(--russet); }
@media (max-width: 560px) { .bookedit { grid-template-columns: 1fr; } }

.adder { display: flex; align-items: baseline; gap: 14px; padding: 16px 0;
  border-bottom: 1px solid var(--sep); cursor: pointer; color: var(--ink2); }
.adder:hover { color: var(--ink); }
.adder .px { color: var(--ink3); margin-left: auto; }
.adder.busy { cursor: wait; }
#drop { position: fixed; inset: 0; z-index: 60; background: var(--ink);
  color: var(--paper); display: grid; place-items: center; font-size: 36px;
  font-variant-caps: all-small-caps; letter-spacing: .2em; }

/* ---------------------------------------------------------- reader */

#text { max-width: var(--measure); margin: 0 auto; padding: 56px 24px 30vh;
  font-size: var(--size); line-height: 1.55; position: relative;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-feature-settings: "kern", "liga"; }
#text > p { margin: 0; text-align: justify; hyphens: auto; -webkit-hyphens: auto;
  hyphenate-limit-chars: 6 3 3; text-indent: 1.4em; position: relative;
  content-visibility: auto; contain-intrinsic-size: auto 5em;
  overflow-wrap: break-word; cursor: text; }
#text > p.first, #text > h3 + p, #text > .titlepage + p { text-indent: 0; }
#text.ragged > p { text-align: left; }
#text h3 { font-weight: 400; text-align: center; margin: 2.6em 0 1.2em;
  font-size: 1em; font-variant-caps: all-small-caps; letter-spacing: .14em;
  line-height: 1.3; content-visibility: auto; text-wrap: balance; }
#text .titlepage { text-align: center; margin: 8vh 0 12vh; }
#text .titlepage .author { font-variant-caps: all-small-caps; letter-spacing: .14em;
  color: var(--ink2); }
#text .titlepage .title { font-style: italic; font-size: 1.9em; line-height: 1.15;
  margin-top: .3em; text-wrap: balance; }
#text .titlepage .sub { color: var(--ink2); margin-top: .5em; text-wrap: balance; }
#text .titlepage .rule { width: 64px; border-top: 1px solid var(--ink);
  margin: 1.2em auto 0; }

/* Paragraph numbers sit in the margin like a critical edition's line
   numbers; a number in moss has a translation behind it. */
/* content-visibility clips a paragraph to its own box, so the number's
   margin is made part of the box: padded out, and pulled back by as much. */
@media (min-width: 761px) {
  #text > p { padding-left: 4.4em; margin-left: -4.4em; } }
#text > p .no { position: absolute; left: 0; width: 3em; text-align: right;
  top: .45em; text-indent: 0; font-family: var(--pixel); font-size: 16px;
  line-height: 1; color: var(--rule); cursor: pointer; user-select: none;
  -webkit-user-select: none; }
#text > p .no:hover { color: var(--ink); }
#text > p .no.done { color: var(--moss); }
#text > p:hover .no { color: var(--ink3); }
@media (max-width: 760px) { #text > p .no { display: none; } }

/* Interlinear: the reader's own earlier glosses, written small above the
   word. Positioned, not ruby, so a gloss never widens the word beneath it. */
#text.inter > p { line-height: 2.05; }
#text .ig { position: relative; }
#text .ig::before { content: attr(data-g); position: absolute; left: 0;
  bottom: calc(100% - .1em); font-size: .58em; line-height: 1; font-style: italic;
  color: var(--ink3); white-space: nowrap; max-width: calc(100% + 1.4em);
  overflow: hidden; text-overflow: ellipsis; text-indent: 0;
  pointer-events: none; letter-spacing: 0; }

::highlight(seen) { text-decoration: underline dotted var(--ink3);
  text-decoration-thickness: 1px; text-underline-offset: 4px; }
::highlight(kept) { text-decoration: underline double var(--gold);
  text-decoration-thickness: 1px; text-underline-offset: 4px; }
::highlight(tapped) { background-color: var(--ink); color: var(--paper); }

/* The phrase chip appears under a selection and glosses it. */
#chip { position: absolute; z-index: 30; background: var(--ink); color: var(--paper);
  border: 0; padding: 4px 10px; cursor: pointer; font-variant-caps: all-small-caps;
  letter-spacing: .1em; font-size: 17px; }
#chip:hover { background: var(--russet); }

/* --------------------------------------------------------------- note
   A gloss is a footnote on a phone and a scholium in the margin on a wide
   screen: either way it sits beside the text, not on top of it. */

#note { z-index: 35; display: flex; flex-direction: column; font-size: 19px;
  line-height: 1.4; text-align: left; text-indent: 0; hyphens: manual; }
#note::before { content: ""; display: block; border-top: 1px solid var(--ink);
  flex: none; }
#note .scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
#note .inner { max-width: var(--measure); margin: 0 auto; }
#note.foot { position: fixed; left: 0; right: 0;
  bottom: calc(var(--mode) + var(--safe-bottom) + var(--keyboard));
  background: var(--paper); max-height: 60vh; padding: 0 22px 14px; }
#note.foot::before { width: 100%; margin: 0 0 12px; }
#note.foot .inner { padding-top: 0; }
#note.margin { position: absolute; font-size: 17px; }
#note.margin::before { width: 48px; margin-bottom: 10px; }
#note.margin .inner { margin: 0; }
#note .head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
#note .hw { font-weight: 600; font-size: 1.1em; }
#note .hw .from { font-weight: 400; color: var(--ink3); }
#note .pos { color: var(--ink3); font-variant-caps: all-small-caps;
  letter-spacing: .08em; }
#note .gl { margin-top: 4px; }
#note .gl.llm { font-style: italic; }
#note .alts { margin: 8px 0 0; padding: 0; list-style: none; color: var(--ink2);
  font-size: .92em; }
#note .alts li { padding: 2px 0; cursor: pointer; display: flex; gap: 8px; }
#note .alts li::before { content: "·"; color: var(--ink3); }
#note .alts li:hover { color: var(--ink); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px; }
#note .acts { display: flex; gap: 20px; margin-top: 8px; }
#note .acts .act { font-size: 17px; padding: 2px 0; }
#note .err { color: var(--russet); }
#note .thread { margin-top: 10px; border-top: 1px solid var(--sep); }
#note .thread .q { color: var(--ink3); margin-top: 10px; font-style: italic; }
#note .thread .a { margin-top: 4px; }

#note .gl.llm p, #note .thread .a p { margin: 0 0 .4em; }
#note .gl.llm ul, #note .thread .a ul { margin: 0 0 .4em; padding-left: 1.1em; }
#note form .field { font-size: 18px; padding: 6px 0; }
.spin { font-family: var(--pixel); font-size: 16px; color: var(--ink3);
  display: inline-block; width: 1ch; }

/* --------------------------------------------------------------- toc */

#toc { position: fixed; z-index: 50; inset: 0 0 calc(var(--mode) + var(--safe-bottom));
  background: var(--paper); overflow-y: auto; }
#toc ol { list-style: none; margin: 0 auto; padding: 48px 22px; max-width: 34rem; }
#toc li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0;
  border-bottom: 1px solid var(--sep); cursor: pointer;
  font-variant-caps: all-small-caps; letter-spacing: .1em;
  font-variant-ligatures: none; }
#toc li:hover { color: var(--russet); }
#toc li .px { margin-left: auto; color: var(--ink3); }
#toc li.here { font-weight: 600; }

/* --------------------------------------------------------- translate */

#tr { display: grid; height: calc(var(--view) - var(--mode) - var(--safe-bottom)
  - var(--keyboard)); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  max-width: 46rem; margin: 0 auto; }
body.fixed { overflow: hidden; padding-bottom: 0; }
#tr .src { overflow-y: auto; padding: 32px 22px 16px; font-size: var(--size);
  line-height: 1.6; overscroll-behavior: contain; }
#tr .src .w { cursor: pointer; transition: none; }
#tr .src .w.ok { background: color-mix(in srgb, var(--moss) 22%, transparent); }
#tr .src .w.miss { text-decoration: underline wavy var(--russet);
  text-decoration-thickness: 1px; text-underline-offset: 5px;
  background: color-mix(in srgb, var(--russet) 14%, transparent); }
#tr .ed { position: relative; border-top: 1px solid var(--ink); min-height: 0; }
#tr .ed textarea, #tr .ed .mirror { position: absolute; inset: 0; margin: 0;
  padding: 18px 22px; font-family: var(--text); font-size: var(--size);
  line-height: 1.8; white-space: pre-wrap; overflow-wrap: break-word;
  border: 0; border-radius: 0; overflow-y: auto; }
@media (min-width: 1100px) {
  #tr { grid-template-rows: minmax(0, 1fr); grid-template-columns: 1fr 1fr;
    max-width: 88rem; }
  #tr .src { padding: 10vh 36px 40px; }
  #tr .ed { border-top: 0; border-left: 1px solid var(--ink); }
  #tr .ed textarea, #tr .ed .mirror { padding: 10vh 36px 40px; }
}
#tr .ed .mirror { color: transparent; pointer-events: none; scrollbar-width: none; }
#tr .ed .mirror::-webkit-scrollbar { display: none; }
#tr .ed .mirror span { text-decoration-line: underline; text-decoration-thickness: 2px;
  text-underline-offset: 6px; text-decoration-skip-ink: none; }
/* Meaning is carried by shape as well as colour, so it survives an e-ink
   screen or a colour-blind eye: solid is good, dashed is loose, wavy is
   wrong. */
#tr .ed .mirror .g { text-decoration-color: var(--moss); }
#tr .ed .mirror .l { text-decoration-color: var(--gold); text-decoration-style: dashed; }
#tr .ed .mirror .b { text-decoration-color: var(--russet); text-decoration-style: wavy;
  text-decoration-thickness: 1.5px; }
#tr .ed .mirror .n { text-decoration-color: transparent; }
#tr .ed textarea { background: transparent; resize: none; outline: none;
  caret-color: var(--russet); }
#tr .ed textarea::placeholder { color: var(--rule); font-style: italic; }
#sheet { position: fixed; left: 0; right: 0; z-index: 36;
  bottom: calc(var(--mode) + var(--safe-bottom) + var(--keyboard));
  max-height: 55vh; overflow-y: auto; background: var(--paper);
  border-top: 1px solid var(--ink); padding: 14px 22px 18px; }
#sheet .inner { max-width: 42rem; margin: 0 auto; }
#sheet p { margin: 0 0 .6em; }
#sheet ul { margin: 0 0 .6em; padding-left: 1.2em; }
#sheet h4 { margin: 0 0 8px; font-weight: 400; color: var(--ink2);
  font-variant-caps: all-small-caps; letter-spacing: .1em; }
#sheet label { display: flex; gap: 10px; align-items: baseline; padding: 4px 0;
  cursor: pointer; }
#sheet label input { accent-color: var(--ink); }
#sheet label .s { color: var(--ink2); }
#sheet label .s b { color: var(--ink); font-weight: 600; }
#sheet .row { display: flex; gap: 22px; margin-top: 10px; align-items: baseline; }

/* ------------------------------------------------------------ review */

.deck { max-width: 38rem; margin: 0 auto; padding: 10vh 22px 40px;
  min-height: calc(var(--view) - var(--mode) - var(--safe-bottom));
  display: flex; flex-direction: column; }
.deck .src { color: var(--ink3); font-variant-caps: all-small-caps;
  letter-spacing: .1em; text-align: center; font-size: 17px; }
.deck .sentence { font-size: 26px; line-height: 1.5; text-align: center;
  margin: 18px 0 0; text-wrap: pretty; }
.deck .sentence mark { background: var(--ink); color: var(--paper);
  padding: 0 .15em; }
.deck .answer { margin-top: 36px; text-align: center; min-height: 5em; }
.deck .answer .hw { font-weight: 600; font-size: 22px; }
.deck .answer .gl { font-size: 21px; margin-top: 4px; }
.deck .answer .gl[contenteditable] { outline: none; border-bottom: 1px solid transparent; }
.deck .answer .gl[contenteditable]:focus { border-bottom-color: var(--ink); }
.deck .reveal { margin: 36px auto 0; display: block; }
.deck .grades { margin-top: auto; padding-top: 32px; display: grid;
  grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.deck .grades button { background: none; border: 0; border-right: 1px solid var(--sep);
  padding: 14px 4px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 6px; font-variant-caps: all-small-caps;
  letter-spacing: .08em; font-size: 19px; }
.deck .grades button:last-child { border-right: 0; }
.deck .grades button:hover { background: var(--ink); color: var(--paper); }
.deck .grades button .px { color: var(--ink3); }
.deck .grades button:hover .px { color: var(--paper3); }
.deck .grades button.again { color: var(--russet); }
.deck .empty { margin: auto; text-align: center; }
.deck .empty .n { font-size: 96px; line-height: 1; font-variant-numeric: lining-nums; }
.deck .empty .px { color: var(--ink3); margin-top: 14px; display: block; }

/* -------------------------------------------------------------- words */

table.words { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.words td { padding: 9px 8px 8px 0; border-bottom: 1px solid var(--sep);
  vertical-align: baseline; }
table.words td.w { font-weight: 600; white-space: nowrap; }
table.words td.g { color: var(--ink2); }
table.words td.d { text-align: right; white-space: nowrap; color: var(--ink3); }
table.words td.x button { background: none; border: 0; color: var(--rule);
  cursor: pointer; font-family: var(--pixel); font-size: 16px; padding: 0 0 0 8px; }
table.words td.x button:hover { color: var(--russet); }
table.words tr.lang td { border-bottom: 1px solid var(--ink); padding-top: 28px;
  color: var(--ink2); font-variant-caps: all-small-caps; letter-spacing: .12em; }
table.words .s { display: block; color: var(--ink3); font-size: .85em;
  font-style: italic; }
@media (max-width: 560px) { table.words td.d { display: none; } }

/* ---------------------------------------------------------- settings */

.prefs { display: grid; grid-template-columns: 9em 1fr; gap: 18px 24px;
  align-items: baseline; margin-top: 18px; }
.prefs > .k { color: var(--ink3); font-variant-caps: all-small-caps; letter-spacing: .08em; }
.prefs .opts { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.prefs .opts button { background: none; border: 0; padding: 2px 0; cursor: pointer;
  color: var(--ink3); border-bottom: 1px solid transparent; font-size: 19px; }
.prefs .opts button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.prefs input[type=range] { width: 100%; -webkit-appearance: none; appearance: none;
  background: transparent; height: 28px; margin: 0; cursor: pointer; }
.prefs input[type=range]::-webkit-slider-runnable-track { height: 1px; background: var(--ink); }
.prefs input[type=range]::-moz-range-track { height: 1px; background: var(--ink); }
.prefs input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px;
  height: 22px; background: var(--ink); border: 0; border-radius: 0; margin-top: -11px; }
.prefs input[type=range]::-moz-range-thumb { width: 14px; height: 22px;
  background: var(--ink); border: 0; border-radius: 0; }
.sample { font-size: var(--size); line-height: 1.55; margin: 6px 0 0;
  text-align: justify; hyphens: auto; }
@media (max-width: 560px) { .prefs { grid-template-columns: 1fr; gap: 6px; }
  .prefs > .k { margin-top: 18px; } }
.invites { list-style: none; padding: 0; margin: 8px 0 0; }
.invites li { display: flex; gap: 12px; align-items: baseline; padding: 6px 0;
  border-bottom: 1px solid var(--sep); }
.invites li .px { word-break: break-all; }
.invites li .used { color: var(--ink3); margin-left: auto; }

/* --------------------------------------------------------------- door */

.door { max-width: 24rem; margin: 0 auto; padding: 18vh 22px 40px; }
.door form { margin-top: 28px; }
.door .block { margin-top: 32px; width: 100%; }
.door .err { color: var(--russet); margin-top: 14px; min-height: 1.4em; }
.door .switch { margin-top: 22px; text-align: center; }

.err { color: var(--russet); }
.toast { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--mode) + var(--safe-bottom) + 14px); background: var(--russet);
  color: var(--paper); padding: 8px 16px; max-width: calc(100vw - 32px); }

/* -------------------------------------------------------- languages */

.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5em, 1fr));
  gap: 0; margin: 8px 0 32px; border-top: 1px solid var(--sep); }
.picker button { background: none; border: 0; border-bottom: 1px solid var(--sep);
  padding: 14px 4px; text-align: left; font-size: 22px; cursor: pointer;
  color: var(--ink3); }
.picker button[aria-pressed="true"] { color: var(--paper); background: var(--ink); }
.picker button:hover:not([aria-pressed="true"]) { color: var(--ink); }
.picker.compact { margin: 14px 0 0; }
.picker.compact button { font-size: 19px; padding: 10px 6px; }
.door .picker + .block { margin-top: 0; }

/* -------------------------------------------------------------- find */

.search { margin: 18px 0 0; }
.search .field { font-size: 22px; }
.search .field::placeholder { color: var(--rule); font-style: italic; }
h2.sect.minor { font-size: 17px; border-bottom-color: var(--rule); margin-top: 34px; }
.shelf .book.pick .meta { flex-direction: row; align-items: center; gap: 14px; }
.shelf .book.pick .act { font-size: 18px; }
.page > div > .act.more { margin-top: 18px; }
a.adder { text-decoration: none; }

#note .src { margin-left: auto; color: var(--ink3); font-style: italic;
  font-size: .85em; text-decoration: none; }
#note .src:hover { color: var(--ink); text-decoration: underline; }
.credits { margin-top: 14px; line-height: 1.6; }
.credits a { color: var(--ink2); }

/* ------------------------------------------------------- conversation
   A sheet over the lower page on a phone, a column on a wide screen.
   Ruled, not shadowed: the page it covers is still paper. */

#talk { position: fixed; z-index: 38; background: var(--paper);
  display: flex; flex-direction: column; left: 0; right: 0;
  bottom: calc(var(--mode) + var(--safe-bottom) + var(--keyboard));
  height: min(52vh, calc(var(--view) - var(--mode) - var(--safe-bottom)
    - var(--keyboard) - 96px));
  border-top: 1px solid var(--ink); font-size: 18px; line-height: 1.45; }
@media (max-width: 1099px) {
  #talk .bar .title { visibility: hidden; }
}
@media (min-width: 1100px) {
  #talk { top: 0; left: auto; width: 420px; height: auto;
    border-top: 0; border-left: 1px solid var(--ink); font-size: 17px; }
  body.talking main { margin-right: 420px; }
}
#talk .bar { display: flex; align-items: baseline; gap: 18px; flex: none;
  padding: 8px 20px 6px; border-bottom: 1px solid var(--sep); }
#talk .bar .title { margin-right: auto; color: var(--ink2); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  font-variant-caps: all-small-caps; letter-spacing: .1em; }
#talk .bar .act { font-size: 17px; padding: 2px 0; }
#talk .log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 20px 14px; }
#talk .g { margin: 14px 0 0; padding-left: 10px; border-left: 2px solid var(--rule); }
#talk .g .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
#talk .g .pos { color: var(--ink3); font-variant-caps: all-small-caps;
  letter-spacing: .08em; font-variant-ligatures: none; }
#talk .q { margin: 16px 0 0; font-style: italic; color: var(--ink2); }
#talk .q .about { font-style: normal; color: var(--ink3); margin-right: 8px; }
#talk .a { margin: 6px 0 0; }
#talk .a p { margin: 0 0 .5em; }
#talk .a ul { margin: 0 0 .5em; padding-left: 1.1em; }
#talk .compose { display: flex; flex: none; align-items: stretch;
  margin: 0 20px 14px; border: 1px solid var(--ink); }
#talk .chip { display: flex; align-items: center; gap: 2px; padding: 0 2px 0 10px;
  color: var(--ink2); white-space: nowrap; max-width: 45%; overflow: hidden; }
#talk .chip[hidden] { display: none; }
#talk .chip button { background: none; border: 0; color: var(--ink3); cursor: pointer;
  font-family: var(--pixel); font-size: 16px; padding: 0 6px; }
#talk .ask { flex: 1; min-width: 0; border: 0; background: var(--paper);
  padding: 9px 10px; font: inherit; outline: none; border-radius: 0; }
#talk .ask::placeholder { color: var(--ink3); font-style: italic; }
#talk .ask:disabled { background: var(--paper2); }
#talk .send { border: 0; background: var(--ink); color: var(--paper);
  padding: 0 14px; cursor: pointer; font-variant-caps: all-small-caps;
  letter-spacing: .1em; font-size: 17px; border-radius: 0; }
#talk .send:disabled { background: var(--ink3); cursor: wait; }
