:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1b1b1b;
  --muted: #6f6f6f;
  --line: #e4e2dd;
  --accent: #1b1b1b;
  --accent-text: #ffffff;
  --ok: #1f7a4d;
  --danger: #b3261e;
  --msg: #fff6d6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131313;
    --card: #1d1d1d;
    --text: #ececec;
    --muted: #9a9a9a;
    --line: #333;
    --accent: #ececec;
    --accent-text: #131313;
    --ok: #5cc28f;
    --danger: #ff8a80;
    --msg: #3a3320;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; }
h1 { font-size: 28px; line-height: 1.2; margin: 8px 0 16px; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
.break { word-break: break-all; }

.top {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.logo { text-decoration: none; font-size: 17px; }
nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 15px; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--text); }

main { flex: 1; width: 100%; margin: 0 auto; padding: 16px; }
main.narrow { max-width: 560px; }
main.wide { max-width: 1100px; }
footer { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; margin-bottom: 16px;
}
.lead { color: var(--muted); margin-top: -6px; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: 8px 0 0; }
.msg { background: var(--msg); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.nowrap { white-space: nowrap; }

label { display: block; font-size: 14px; margin: 0 0 6px; }
label.check { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
input[type=email], input[type=search], input[type=text], textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
textarea { resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; }

.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent);
  border-radius: 8px; padding: 11px 18px; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; margin-top: 12px;
}
.btn small { font-weight: 400; font-size: 12px; opacity: .8; }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn.small { padding: 6px 12px; font-size: 14px; margin-top: 0; }
form .btn[type=submit] { width: 100%; }
form .btn.small[type=submit] { width: auto; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.linkbtn:hover { color: var(--text); }
form.inline { display: inline; }

main.medium { max-width: 760px; }
.back { margin: 0 0 8px; font-size: 14px; }
.back a { color: var(--muted); text-decoration: none; }
.progress { display: block; height: 4px; background: var(--line); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ok); }

/* плеер */
.p-head { display: flex; gap: 18px; align-items: center; }
.p-cover { width: 132px; height: 132px; border-radius: 10px; flex: none; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.p-info h1 { margin: 2px 0 6px; font-size: 24px; }
.p-chapter { color: var(--muted); font-size: 15px; min-height: 1.4em; }
.p-seek { width: 100%; margin: 22px 0 4px; accent-color: var(--accent); height: 28px; cursor: pointer; }
.p-times { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-controls { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 12px 0 8px; }
.p-btn {
  background: none; border: 0; color: var(--text); cursor: pointer; padding: 8px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent;
}
.p-btn:hover { background: var(--bg); }
.p-play { width: 68px; height: 68px; background: var(--accent); color: var(--accent-text); }
.p-play:hover { background: var(--accent); opacity: .9; }
.p-extra { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.p-extra label { margin: 0; }
.p-extra select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li button {
  width: 100%; display: flex; justify-content: space-between; gap: 12px; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text);
  font: inherit; font-size: 15px; padding: 10px 6px; cursor: pointer;
}
.toc li:last-child button { border-bottom: 0; }
.toc li button:hover { background: var(--bg); }
.toc li .t { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.toc li.section button { font-weight: 700; padding-top: 16px; }
.toc li.current button { background: var(--msg); border-radius: 6px; }
@media (max-width: 520px) {
  .p-head { gap: 14px; }
  .p-cover { width: 96px; height: 96px; }
  .p-info h1 { font-size: 20px; }
  .p-controls { gap: 6px; }
}

.hero { display: block; width: 100%; height: auto; border-radius: 12px; margin-top: 8px; }
.tile.buy .cover { filter: saturate(.55) brightness(.9); }
.tile.buy:hover .cover { filter: none; }
.tile.buy .label { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; }
.tile.buy .btn { margin-top: 6px; }
.books { display: grid; gap: 12px; }
.book h2 { margin-bottom: 12px; }
.tiles { display: flex; gap: 16px; flex-wrap: wrap; align-items: stretch; }
.tile > .btn:last-child { margin-top: auto; }
.tile > .cover + .btn, .tile > .progress + .btn { margin-top: 12px; }
.tile { display: flex; flex-direction: column; text-decoration: none; width: 200px; max-width: calc(50% - 8px); }
.tile .cover { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.18); transition: transform .15s; }
.tile:hover .cover { transform: translateY(-2px); }
.tile .btn { margin-top: 12px; }
.paper { margin-top: 24px; }
.paper-covers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 4px; }
.paper-covers img { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.15); display: block; }
.paper .btn { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { min-width: 150px; }

.list .row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.list .row:last-child { border-bottom: 0; }
.tag {
  display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px;
  border: 1px solid var(--line); color: var(--muted); margin: 2px 2px 2px 0; white-space: nowrap;
}
.tag.ok { color: var(--ok); border-color: var(--ok); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
table.grid { margin: 12px 0; }
table.grid td:not(:first-child), table.grid th:not(:first-child) { text-align: center; width: 90px; }
.search { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.search input { flex: 1; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.cols { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .cols { grid-template-columns: 1fr 1fr; } }
.cols .card { margin-bottom: 0; }
.users { display: block; overflow-x: auto; }
