:root {
  --bg: #f5f3ee; --card: #ffffff; --text: #0f101c; --muted: #6b6a73;
  --accent: #e8374f; --accent-2: #b3203a; --border: #e6e2d8; --ok: #1f7a4d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f101c; --card: #1a1b2b; --text: #f5f3ee; --muted: #a3a2b0;
    --accent: #ff5670; --accent-2: #e8374f; --border: #2c2d42; --ok: #4cc38a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.55;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }

header.site { border-bottom: 1px solid var(--border); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
header.site nav a { color: var(--muted); text-decoration: none; font-size: .92rem; margin-left: 16px; }
header.site nav a:hover { color: var(--accent); }

.hero { text-align: center; padding: 48px 0 28px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1.15; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); max-width: 560px; margin: 14px auto 0; }
.badges { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-top: 18px; font-size: .88rem; color: var(--muted); }

.chips { display: flex; gap: 8px; justify-content: center; margin: 8px 0 24px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 999px; padding: 7px 16px; font: inherit; font-size: .9rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

main { flex: 1; padding-bottom: 56px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.book { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.book:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 30px rgba(232,55,79,.16); }
.book img { width: 100%; aspect-ratio: 5 / 8; object-fit: cover; background: var(--border); display: block; }
.book .info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.book h2 { font-size: 1rem; line-height: 1.3; }
.book .price { margin-top: auto; font-weight: 700; color: var(--accent); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: .72rem; border: 1px solid var(--border); border-radius: 6px; padding: 1px 7px; color: var(--muted); }

.detail { display: grid; gap: 32px; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); padding-top: 36px; align-items: start; }
@media (max-width: 720px) { .detail { grid-template-columns: 1fr; } .detail .cover { max-width: 260px; margin: 0 auto; } }
.detail .cover { width: 100%; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.2); display: block; }
.detail h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.2; letter-spacing: -.015em; }
.detail .sub { color: var(--muted); margin: 8px 0 4px; }
.detail .by { font-size: .9rem; color: var(--muted); }
.desc { margin-top: 20px; }
.desc p { margin-bottom: 12px; }
.desc ul { margin: 0 0 12px 20px; }
.offers { display: grid; gap: 10px; margin-top: 24px; }
.offer { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.offer.best { border-color: var(--accent); }
.offer small { color: var(--muted); display: block; }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
.btn:hover { background: var(--accent-2); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.note { font-size: .85rem; color: var(--muted); margin-top: 12px; }
.soon { opacity: .65; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin: 40px auto; max-width: 560px; }
.panel h1 { font-size: 1.5rem; margin-bottom: 6px; }
.panel .row { display: flex; gap: 14px; align-items: center; margin: 14px 0; }
.panel img { width: 72px; border-radius: 6px; }
.panel audio { width: 100%; margin-top: 8px; }
.dl { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.err { color: var(--accent); }

.legal { max-width: 720px; padding-top: 32px; }
.legal h1 { margin-bottom: 14px; }
.legal h2 { font-size: 1.1rem; margin: 22px 0 6px; }
.legal p, .legal li { margin-bottom: 8px; }
.legal ul { margin-left: 20px; }

footer.site { border-top: 1px solid var(--border); padding: 22px 0; font-size: .85rem; color: var(--muted); text-align: center; }
footer.site a { color: var(--muted); margin: 0 8px; }
