/* The proofreading page: the real page on the left, a sheet of paper on the
   right. The site's own colours; the reader's wording is in the site's pen
   blue, the one thing that stands out. Laptop first; on a phone the paper
   becomes a sheet under the page. */
:root {
  --night: #0a0a0a;
  --paper: #f1ecdf;
  --paper-2: #e7e0cf;
  --ink: #17140f;
  --ink-muted: #5d574b;
  --rule: #cfc6b0;
  --pen: #2f49c9;
  --glow: #ffc46b;
  --red: #c4253a;
  --journey: linear-gradient(90deg, #1db954, #00d4ff);
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--night); color: var(--ink); font: 15px/1.5 var(--body); }
[hidden] { display: none !important; }
button, textarea, input { font: inherit; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }

.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 32%);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}
.bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 8px 12px; background: #151515; color: #f2efe8; border-bottom: 1px solid #2a2a2a;
}
.pages { display: flex; flex-wrap: wrap; gap: 4px; }
.pages button {
  background: none; border: 0; color: #a39f95; padding: 4px 8px; border-radius: 6px; cursor: pointer;
}
.pages button:hover { color: #f2efe8; }
.pages button[aria-current='page'] { color: #f2efe8; background: #2a2a2a; }
.pages button .n { font-size: 12px; color: var(--glow); margin-left: 4px; }
.progress { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: #a39f95; }
.meter { width: 120px; height: 4px; background: #2a2a2a; border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--journey); transition: width 0.3s; }
.stage { grid-column: 1; grid-row: 2; min-height: 0; }
.stage iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--night); }

.panel {
  grid-column: 2; grid-row: 1 / span 2; overflow-y: auto;
  background: var(--paper); padding: 20px 22px 32px; border-left: 1px solid var(--rule);
}
.panel h1 { font-size: 20px; margin: 0 0 4px; }
.panel h2 { font-size: 13px; font-weight: 600; color: var(--ink-muted); margin: 20px 0 6px; }
.panel p { margin: 0 0 10px; }
.small { font-size: 13px; color: var(--ink-muted); }
.where { font-size: 13px; color: var(--ink-muted); margin-bottom: 12px; }
.english { padding: 10px 12px; background: var(--paper-2); border-radius: 6px; }
.english a { color: inherit; pointer-events: none; }
textarea {
  width: 100%; min-height: 120px; resize: vertical; padding: 10px 12px; margin-top: 2px;
  color: var(--ink); background: #fbf8f1; border: 1px solid var(--rule); border-radius: 6px;
}
textarea.mine { color: var(--pen); }
textarea[readonly] { background: var(--paper-2); }
input[type='text'] {
  width: 100%; padding: 8px 12px; background: #fbf8f1; border: 1px solid var(--rule); border-radius: 6px;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.btn {
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
.btn.ghost { background: none; color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--pen); text-decoration: underline; cursor: pointer; }
.status { font-size: 13px; margin: 8px 0; }
.status.fix { color: var(--pen); }
.status.changed, .problem { color: var(--red); }
.problem { font-size: 13px; margin: 6px 0 0; }
.other { border-top: 1px solid var(--rule); margin-top: 20px; padding-top: 4px; }
.other .text { color: var(--ink-muted); }
.other .text.mine { color: var(--pen); }
.nav { display: flex; justify-content: space-between; margin-top: 16px; }

.legend { list-style: none; padding: 0; margin: 0 0 10px; font-size: 13px; }
.legend li { margin: 4px 0; }
.legend span { text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.u-unread { text-decoration: underline dotted var(--glow); }
.u-fix { text-decoration: underline var(--pen); }
.u-changed { text-decoration: underline wavy var(--red); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { border-top: 1px solid var(--rule); }
.list button {
  display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 0; cursor: pointer; color: var(--ink);
}
.list button small { display: block; color: var(--ink-muted); }
.list button[data-s='fix'] { color: var(--pen); }
.list button[data-s='changed'] small { color: var(--red); }
.list button[data-s='unread']::before { content: '\2022 '; color: #b07a1c; }
details.brief { margin-top: 20px; border-top: 1px solid var(--rule); padding-top: 8px; }
details.brief summary { cursor: pointer; font-weight: 600; }
details.brief li { margin: 6px 0; }
label.toggle { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 8px 0; }

.gate { max-width: 480px; margin: 20vh auto; padding: 24px; color: #f2efe8; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) minmax(0, 50%); }
  .panel { grid-column: 1; grid-row: 3; border-left: 0; border-top: 1px solid var(--rule); padding: 16px; }
  .progress { margin-left: 0; }
}

/* Jamie's results view. */
body.results { background: var(--paper); }
.sheet { max-width: 1400px; margin: 0 auto; padding: 24px 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.filters button { border: 1px solid var(--rule); background: none; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.filters button[aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 8px; border-top: 1px solid var(--rule); }
td.s-fix > div:first-child { color: var(--pen); }
td.s-changed .small, td.s-unread .small { color: #b07a1c; }
td del { display: block; margin-top: 4px; }
td .note { margin-top: 4px; padding: 4px 8px; background: var(--paper-2); border-radius: 4px; }
code { font-size: 12px; color: var(--ink-muted); }
@media (max-width: 900px) { table, thead, tbody, tr, th, td { display: block; } thead { display: none; } tr { border-top: 2px solid var(--ink); } }
