:root {
  color-scheme: light dark;
  --bg: #FBFBF9; --ink: #151715; --sub: #5E625E; --rule: #DEDDD7; --surf: #F2F2EE;
  --acc: #0F5F33; --onacc: #FFFFFF; --track: #D3D3CC;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121412; --ink: #ECEEEB; --sub: #A2A7A1; --rule: #2E322E; --surf: #1B1E1B;
    --acc: #7FD39C; --onacc: #0B1A10; --track: #3A3F3A; }
}
* { box-sizing: border-box; }

body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  display: flex; flex-direction: column; min-height: 100dvh;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
main:focus { outline: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { flex: none; }

/* Header: phone bar (back / about) and desktop nav */
#top { flex: none; position: sticky; top: 0; z-index: 2; background: var(--bg); padding-top: env(safe-area-inset-top); }
.bar { height: 52px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 8px; }
.bar .l { display: flex; } .bar .r { display: flex; justify-content: flex-end; gap: 2px; }
.bar .t { font-size: 17px; font-weight: 600; text-align: center; }
.icon { width: 44px; height: 44px; border: 0; background: none; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 22px; text-decoration: none; }
.txt { height: 44px; padding: 0 10px; border: 0; background: none; font-size: 16px; color: var(--acc); border-radius: 8px; }
.txt:disabled { color: var(--sub); cursor: default; }
.desk { display: none; }

main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 4px 24px 40px; }
h1 { margin: 0; font-size: 30px; line-height: 1.12; font-weight: 700; letter-spacing: -0.01em; }
.part { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--sub); }
.head { margin: 6px 0 0; font-size: 19px; line-height: 1.35; color: var(--sub); }
.q { margin-top: 28px; }
.q h2 { margin: 0; font-size: 18px; line-height: 1.55; font-weight: 600; }
.q p { margin: 12px 0 0; font-size: 18px; line-height: 1.6; }
.note { display: block; margin-top: 36px; border-top: 1px solid var(--rule); padding-top: 16px; }
.note textarea { display: block; width: 100%; min-height: 140px; border: 0; padding: 0; background: transparent; resize: none;
  font: inherit; font-size: 18px; line-height: 1.6; color: var(--ink); field-sizing: content; }
.note textarea::placeholder { color: var(--sub); opacity: 1; }
.note textarea:focus-visible { outline: none; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.ph { margin: 0; padding: 24px 0 6px; font-size: 15px; font-weight: 600; color: var(--sub); }
.row { min-height: 64px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--rule); text-decoration: none; padding: 10px 0; }
.row .m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .a { font-size: 17px; }
.row .b { font-size: 15px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.cur .a { color: var(--acc); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--acc); }
.ruled { border-top: 1px solid var(--rule); }
.titlerow { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.titlerow .acts { display: none; gap: 4px; margin-right: -10px; }
.nrow { display: flex; align-items: flex-start; gap: 8px; border-bottom: 1px solid var(--rule); }
.nrow a { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 14px 0; text-decoration: none; }
.nrow .a { font-size: 17px; font-weight: 600; }
.nrow .b { font-size: 15px; line-height: 1.45; color: var(--sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.nrow .icon { color: var(--sub); margin: 8px -10px 0 0; }
.small { margin: 20px 0 0; font-size: 13px; line-height: 1.45; color: var(--sub); }
.empty { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 50vh; margin: 0; font-size: 17px; color: var(--sub); text-align: center; }

/* About */
.sub { margin: 6px 0 0; font-size: 19px; color: var(--sub); }
.dl { margin-top: 28px; }
.dl a { min-height: 56px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--rule); text-decoration: none; font-size: 17px; }
.dl a span:first-child { flex: 1; }
.dl .size { font-size: 15px; color: var(--sub); font-variant-numeric: tabular-nums; }
.dl svg { color: var(--acc); }
.about h2 { margin: 36px 0 0; font-size: 21px; line-height: 1.3; font-weight: 600; }
.about p.t { margin: 14px 0 0; font-size: 17px; line-height: 1.6; }
.about strong { font-weight: 600; }

/* Player */
#foot { flex: none; position: sticky; bottom: 0; z-index: 2; background: var(--surf); padding-bottom: env(safe-area-inset-bottom); }
#foot:empty, #foot.none { padding: 0; }
#player { border-top: 1px solid var(--rule); background: var(--surf); }
#player .in { max-width: 640px; margin: 0 auto; padding: 12px 20px 10px; }
.scrub { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--sub); font-variant-numeric: tabular-nums; }
.scrub span { width: 38px; } .scrub span:last-child { text-align: right; }
#seek { flex: 1; height: 28px; margin: 0; background: none; -webkit-appearance: none; appearance: none; --p: 0%; }
#seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(var(--ink), var(--ink)) 0 / var(--p) 100% no-repeat, var(--track); }
#seek::-moz-range-track { height: 4px; border-radius: 2px; background: var(--track); }
#seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ink); }
#seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 7px; background: var(--ink); border: 0; }
#seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 7px; background: var(--ink); border: 0; }
.ctl { position: relative; display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 6px; }
.play { width: 56px; height: 56px; border: 0; border-radius: 28px; background: var(--acc); color: var(--onacc); display: flex; align-items: center; justify-content: center; padding: 0; }
.skip { width: 44px; height: 44px; border: 0; background: none; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 22px; }
#speed { position: absolute; right: -6px; min-width: 44px; height: 44px; border: 0; background: none; font-size: 15px; font-weight: 600; padding: 0 6px; border-radius: 8px; }
.err { display: flex; align-items: center; gap: 12px; }
.err p { margin: 0; flex: 1; font-size: 15px; line-height: 1.4; }
.err .txt { font-weight: 600; }

/* Phone tabs */
#tabs { display: flex; border-top: 1px solid var(--rule); background: var(--surf); padding: 4px 8px; }
#player + #tabs { border-top: 0; }
#tabs a { flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--sub); text-decoration: none; font-size: 12px; font-weight: 500; border-radius: 10px; }
#tabs a[aria-current] { color: var(--acc); font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: 15px; width: max-content; max-width: calc(100vw - 48px); }
#loading { color: var(--sub); }

@media (min-width: 720px) {
  .bar { display: none; }
  .desk { display: block; border-bottom: 1px solid var(--rule); }
  .desk .in { max-width: 1040px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
  .desk .name { font-size: 17px; font-weight: 600; text-decoration: none; }
  .desk nav { display: flex; margin-right: -14px; }
  .desk nav a { height: 44px; display: flex; align-items: center; padding: 0 14px; text-decoration: none; font-size: 15px; border-radius: 8px; }
  .desk nav a[aria-current] { color: var(--acc); font-weight: 600; }
  main { padding-top: 56px; padding-bottom: 64px; }
  main.listv { padding-top: 40px; }
  h1 { font-size: 40px; }
  #tabs { display: none; }
  #player .in { display: flex; align-items: center; gap: 12px; padding: 14px 24px; }
  #player .scrub { flex: 1; order: 2; padding: 0 8px; }
  #player .ctl { display: contents; }
  #player .play { width: 48px; height: 48px; order: 0; }
  #player .skip { order: 1; }
  #speed { position: static; order: 3; }
  .titlerow .acts { display: flex; }
  .backlink { display: inline-flex !important; }
  #toast { bottom: 120px; }
}
.backlink { display: none; align-items: center; gap: 4px; margin: -24px 0 20px -6px; height: 44px; padding: 0 8px 0 2px; color: var(--acc); text-decoration: none; font-size: 16px; border-radius: 8px; }
@media (prefers-reduced-motion: no-preference) { #toast { transition: opacity .2s; } }
.desk-only { display: none; }
@media (min-width: 720px) {
  .desk-only { display: block; }
  #foot:not(:has(#player:not([hidden]))) { padding: 0; background: none; }
}
