:root { color-scheme: light dark; --accent: #2b6cb0; --hl: #ffe08a; }
body { font: 18px/1.7 Georgia, serif; margin: 0; }
.top { padding: .6rem 1rem; border-bottom: 1px solid #8884; font-family: system-ui, sans-serif;
  display: flex; justify-content: space-between; align-items: center; }
.top form { margin: 0; }
.top a { text-decoration: none; font-weight: 600; color: inherit; }
main { max-width: 42rem; margin: 0 auto; padding: 1rem 1rem 14rem; }
h1, h2, h3, button, label, input, textarea { font-family: system-ui, sans-serif; }
.muted, .note { color: #888; }
.note { font-size: .85rem; margin: 0; font-style: italic; }

.stories { list-style: none; padding: 0; }
.stories li { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-bottom: 1px solid #8883; }
.stories form { margin: 0; }
.upload input[type=text], .upload textarea { width: 100%; box-sizing: border-box; font: inherit; }
.upload label { display: block; font-size: .9rem; }
.errorlist { color: #c53030; margin: .2rem 0; padding: 0; list-style: none; font-size: .9rem; }

button { font-size: 1rem; padding: .4rem .9rem; cursor: pointer; }
button.link { background: none; border: 0; color: var(--accent); padding: .2rem .4rem; }
button.danger { color: #c53030; }

#story p { white-space: pre-line; }
.w { cursor: pointer; border-radius: 3px; }
.w:hover { background: #8883; }
.w.selected { background: var(--hl); color: #111; }

#panel { position: fixed; left: 0; right: 0; bottom: 0; max-height: 45vh; overflow-y: auto;
  background: Canvas; color: CanvasText; border-top: 2px solid var(--accent);
  box-shadow: 0 -4px 16px #0003; padding: .6rem 1rem 1rem; font-family: system-ui, sans-serif; font-size: 16px; line-height: 1.4; }
#panel[hidden] { display: none; }
.panel-head { display: flex; align-items: center; gap: .5rem; }
.panel-head strong { font-size: 1.3rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel h3 { margin: .8rem 0 .2rem; font-size: 1rem; }
#panel ol { margin: .2rem 0; padding-left: 1.4rem; }
#panel .phrase-translation { font-size: 1.1rem; margin: .2rem 0; }
#panel ul.words { list-style: none; margin: .2rem 0; padding: 0; }
#panel ul.words li { margin: .2rem 0; }
#panel ul.words .alt { margin-left: 1rem; }
