:root {
  --paper: #EEE0CC;
  --ink: #5A4632;
  --ink-soft: #735E48;
  --rule: #D6C3A8;
  --rule-strong: #B9A386;
  --dash: #A68F72;
  --rust: #9A4A2A;
  --sans: 'Nunito', 'Open Sans', system-ui, sans-serif;
  --gutter: 52px;   /* the left margin where percentages sit, like page numbers */
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
body { -webkit-tap-highlight-color: transparent; }

#queue {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 24px 48px 0;
}

/* ---------- Add a paper ---------- */

#add {
  display: flex; align-items: flex-end; gap: 10px;
  margin: 0 0 0 var(--gutter);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}
#add label { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
#add label span { font-size: 13px; color: var(--ink-soft); }
#add input {
  font: 16px var(--sans); color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px dashed var(--dash);
  padding: 6px 0; border-radius: 0; outline: none; width: 100%;
}
#add input::placeholder { color: var(--ink-soft); opacity: 0.8; }
#add input:focus { border-bottom-style: solid; border-bottom-color: var(--ink); }
#add button {
  font: 700 16px var(--sans); color: var(--rust);
  background: none; border: 0; padding: 12px 4px; min-height: 44px; cursor: pointer;
}
#message { margin: 10px 0 0 var(--gutter); font-size: 14px; color: var(--ink-soft); }
#add button:disabled { color: var(--ink-soft); cursor: default; }

/* ---------- Bands ---------- */

h2 { margin: 22px 0 4px var(--gutter); font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
section[data-band="unread"] h2, section[data-band="finished"] h2 { margin-top: 26px; }
section[data-band="finished"] h2 { color: var(--ink-soft); }
ul { list-style: none; margin: 0; padding: 0; }

.row {
  display: flex; padding: 12px 0; color: var(--ink); text-decoration: none;
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
.row .num {
  flex: 0 0 var(--gutter); padding-right: 12px; text-align: right;
  font-size: 14px; font-weight: 700; color: var(--rust);
  font-variant-numeric: tabular-nums; line-height: 22px;
}
.row .body {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
  padding-bottom: 12px; margin-bottom: -12px;
  border-bottom: 1px solid var(--rule);
}
li:last-child .row .body { border-bottom: 0; }
.row .title { font-size: 17px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.row .source { font-size: 14px; color: var(--ink-soft); }
.row .bar { display: block; height: 2px; background: var(--rule); margin-top: 4px; }
.row .bar span { display: block; height: 2px; background: var(--rust); }
.row.pressed .title { text-decoration: underline; text-decoration-color: var(--rule-strong); }

[data-band="finished"] .row { padding: 10px 0; color: var(--ink-soft); }
[data-band="finished"] .row .num { color: var(--ink-soft); font-weight: 400; font-size: 15px; }
[data-band="finished"] .row .title { font-weight: 400; }
[data-band="finished"] .row .source { color: inherit; }
[data-band="finished"] .row .body { border-bottom: 0; gap: 2px; }

#empty { margin: 28px 0 0 var(--gutter); color: var(--ink-soft); font-size: 15px; }

/* ---------- Long-press sheet ---------- */

#sheet[hidden] { display: none; }
#sheet .backdrop { position: fixed; inset: 0; background: rgba(90, 70, 50, 0.25); }
#sheet .panel {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--paper);
  border-top: 1px solid var(--ink);
  padding: 8px 24px calc(12px + env(safe-area-inset-bottom)) var(--gutter);
  max-width: 640px; margin: 0 auto;
}
#sheet-title { margin: 10px 0 6px; font-size: 15px; font-weight: 700; line-height: 1.3; }
#sheet button {
  display: block; width: 100%; text-align: left;
  font: 600 16px var(--sans); color: var(--ink);
  background: none; border: 0; border-top: 1px solid var(--rule);
  min-height: 48px; padding: 0; cursor: pointer;
}
#sheet button[data-action="remove"] { color: var(--rust); }
#sheet button[data-close] { color: var(--ink-soft); font-weight: 400; }
#sheet button[hidden] { display: none; }
