:root {
  color-scheme: light dark;
  --bg: #f7f6f3;
  --card: #ffffff;
  --text: #1f1f1d;
  --muted: #66645e;
  --line: #dedbd3;
  --accent: #2f5d8a;
  --accent-text: #ffffff;
  --error: #a23a2a;
  --ok: #2f6b3a;
  --pick: #eaf1f8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171716;
    --card: #222220;
    --text: #ecebe7;
    --muted: #a7a49c;
    --line: #3a3935;
    --accent: #8fb6dd;
    --accent-text: #10161c;
    --error: #f0a093;
    --ok: #9ad1a4;
    --pick: #24303b;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
a { color: var(--accent); }
main { max-width: 46rem; margin: 0 auto; padding: 1rem; }
.top {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--card);
}
.brand { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--text); }
.top nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.inline { display: inline; margin: 0; }
.who { color: var(--muted); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: .5rem 0; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin: 1rem 0; }
.narrow { max-width: 24rem; margin: 2rem auto; }
label { display: block; font-weight: 600; margin: .75rem 0 .25rem; }
input:not([type=radio]), textarea {
  width: 100%; padding: .6rem .7rem; font: inherit; color: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
textarea { resize: vertical; }
button, .button {
  display: inline-block; margin-top: 1rem; padding: .6rem 1rem; font: inherit; font-weight: 600;
  border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-text);
  text-decoration: none; cursor: pointer;
}
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button.link { margin: 0; padding: 0; background: none; color: var(--accent); font-weight: 400; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.actions button { margin-top: 0; }
.hint { color: var(--muted); font-weight: 400; font-size: .9rem; }
.error { color: var(--error); }
.notice { color: var(--ok); font-weight: 600; }
.heading-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.heading-row .button { margin-top: 0; }
.tabs { display: flex; gap: .25rem; margin: .5rem 0 1rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .4rem .8rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a[aria-current=page] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.entries { list-style: none; margin: 0; padding: 0; }
.entries li { border-bottom: 1px solid var(--line); }
.entries a {
  display: flex; gap: 1rem; justify-content: space-between; align-items: center;
  padding: .75rem .25rem; text-decoration: none; color: inherit;
}
.titles { display: flex; flex-direction: column; min-width: 0; }
.title-en { font-weight: 600; overflow-wrap: anywhere; }
.title-original { color: var(--muted); overflow-wrap: anywhere; }
p.title-original { margin: 0; font-size: 1.1rem; }
.meta { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; flex-shrink: 0; font-size: .9rem; }
.kind { color: var(--muted); }
.score { font-weight: 600; white-space: nowrap; }
.entry-head .kind { margin: .25rem 0 0; }
.back { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; }
.choice label { display: inline-flex; gap: .4rem; align-items: center; margin-right: 1.5rem; font-weight: 400; }
legend { font-weight: 600; margin-top: .5rem; }
/* Seven equal buttons in one row, down to 320 px wide screens. */
.scores { display: flex; gap: .375rem; }
.scores .score {
  flex: 1 1 0; min-width: 0; margin: 0; padding: 0; height: 2.75rem;
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.scores .score:hover { border-color: var(--accent); }
.scores .score[aria-pressed=true] {
  background: var(--accent); color: var(--accent-text); border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--card);
}
/* Not by color alone: the saved score also carries a check mark. */
.scores .score[aria-pressed=true]::after { content: "✓"; font-size: .75em; margin-left: .1em; }
.scores .score.pending { opacity: .6; }
.scores .score:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.rating-form[aria-busy=true] .score { cursor: progress; }
.rating-bar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; margin-top: .5rem; }
.rating-status { margin: 0; font-weight: 600; }
button.small { margin: 0; padding: .35rem .75rem; font-size: .9rem; }
.guide { margin-top: .5rem; }
.guide summary { display: inline-block; cursor: pointer; color: var(--accent); font-size: .9rem; text-decoration: underline; }
.guide ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.guide li { margin: .25rem 0; }
[hidden] { display: none !important; }
.manage { display: flex; gap: 1rem; margin: .5rem 0 0; }
.danger { color: var(--error); }
button.danger { background: var(--error); color: var(--card); }
.warning { color: var(--error); font-weight: 600; }
a.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--line); margin-top: 0; }
h2 label { display: inline; margin: 0; font-weight: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.empty { color: var(--muted); }
@media (max-width: 30rem) {
  main { padding: .75rem; }
  .card { padding: .75rem; }
  .entries a { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .meta { flex-direction: row; align-items: center; gap: .75rem; }
}
