/* Literati Society — modeled on the old literati.me look: black header, navy page, teal links, copper buttons. */
:root {
  --bg: #263850;
  --bg-dark: #1d2b3f;
  --panel: #55657e;
  --head: #000;
  --menu: #111;
  --text: #fff;
  --muted: #a1a2a4;
  --link: #04b7c4;
  --copper: #c08a6b;
  --copper-dark: #a9734f;
  --patreon: #f96854;
  --line: #3b4d66;
  --ok: #27d18b;
  --warn: #f3b562;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 Roboto, "Segoe UI", Arial, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-weight: 500; line-height: 1.25; }
.wrap { max-width: 1260px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* header */
.top { background: var(--head); position: sticky; top: 0; z-index: 100; }
.top-row { display: flex; align-items: center; gap: 40px; padding-top: 18px; padding-bottom: 10px; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--copper); font: 600 34px/1 Georgia, "Times New Roman", serif; letter-spacing: .06em; text-transform: uppercase; }
.logo:hover { text-decoration: none; }
.search { flex: 1; display: flex; max-width: 800px; margin-left: auto; box-shadow: 0 0 12px rgba(255,255,255,.12); border-radius: 3px; }
.search input { flex: 1; min-width: 0; border: 0; padding: 10px 12px; font-size: 14px; border-radius: 3px 0 0 3px; }
.search button, .filters button, .form button, .actions button { border: 0; background: var(--copper); color: #fff; padding: 0 22px; cursor: pointer; font-size: 14px; }
.search button { border-radius: 0 3px 3px 0; }
.search button:hover, .filters button:hover, .form button:hover { background: var(--copper-dark); }
.account-line { text-align: center; color: var(--muted); font-size: 15px; padding: 6px 0 10px; }
.account-line a, .account-line .link { font-size: 13px; }
.inline { display: inline; }
.link { background: none; border: 0; color: var(--link); cursor: pointer; padding: 0; font: inherit; }
.menu { background: var(--menu); border-top: 1px solid #222; }
.menu .wrap { display: flex; justify-content: center; gap: 36px; padding-top: 12px; padding-bottom: 12px; font-size: 14px; }

main { padding: 18px 16px 60px; min-height: 60vh; }
.flash { padding: 10px 14px; border-radius: 4px; background: var(--bg-dark); border-left: 4px solid var(--link); }
.flash.ok { border-color: var(--ok); }
.flash.warn { border-color: var(--warn); }
.page-title { font-size: 26px; margin: 8px 0 16px; }

/* buttons */
.btn-subscribe, .btn-download, .btn-ghost { display: inline-block; padding: 9px 26px; border-radius: 2px; font-weight: 600; font-size: 15px; text-align: center; border: 0; cursor: pointer; }
.btn-subscribe { background: var(--patreon); color: #fff; }
.btn-download { background: var(--link); color: #fff; }
.btn-ghost { border: 1px solid var(--link); color: var(--link); }
.btn-subscribe:hover, .btn-download:hover, .btn-ghost:hover { text-decoration: none; filter: brightness(1.08); }
.btn-bookmark { padding: 6px 16px; font-size: 13px; font-weight: 500; margin: 2px 0 14px; }
.btn-bookmark.is-bookmarked { border-color: var(--copper); color: var(--copper); }

/* ebook page */
.book-title { font-size: 26px; font-weight: 600; margin: 4px 0 2px; }
.book-byline { margin: 0 0 18px; font-size: 16px; }
.book-top { display: grid; grid-template-columns: 300px 1fr 300px; gap: 20px 32px; align-items: start; }
.book-cover { background: #000; border: 2px solid #444; border-radius: 6px; padding: 18px 26px; box-shadow: 0 0 0 1px #000, 0 4px 18px rgba(0,0,0,.45); display: flex; justify-content: center; }
.book-cover img { display: block; width: 100%; max-width: 260px; aspect-ratio: 2 / 3; object-fit: cover; }
.book-info h3, .book-get h3 { font-size: 14px; font-weight: 500; margin: 6px 0 10px; }
.type-chip { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 0 18px 24px; color: var(--link); font-size: 10px; }
.type-chip svg { width: 28px; height: 28px; padding: 3px; border: 1px solid var(--link); fill: none; stroke: currentColor; stroke-width: 1.6; }
.leaders { margin: 0; font-size: 12px; }
.leaders div { display: flex; align-items: baseline; margin: 0 0 8px; }
.leaders dt { white-space: nowrap; flex: 0 0 98px; display: flex; }
.leaders dt::after { content: ""; flex: 1; border-bottom: 1px dotted var(--muted); margin: 0 2px 4px 4px; }
.leaders dd { margin: 0; }
.book-get { text-align: center; }
.book-get .btn-subscribe { min-width: 196px; white-space: nowrap; margin: 0 0 70px; }
.devices { display: flex; justify-content: center; gap: 16px; margin: 0 0 8px; color: var(--link); }
.devices svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.devices svg:nth-child(4), .devices svg:nth-child(5), .devices svg:nth-child(6) { fill: currentColor; stroke: none; }
.devices svg:nth-child(5) { fill: none; stroke: currentColor; }
.access-box { background: var(--link); color: #145a63; border: 3px solid #8a2d3b; border-radius: 10px; padding: 8px 10px; margin: 0; font-size: 14px; line-height: 1.5; }
.access-box a { color: #fff; text-decoration: underline; }
.book-get .btn-download { width: 100%; padding: 12px; }
.book-terms { margin: 20px 0 0; font-size: 14px; }
.book-terms p { margin: 0; }
.tabs { display: flex; justify-content: space-around; background: var(--panel); border-radius: 4px; margin: 50px 0 34px; padding: 10px 0; font-size: 14px; }
.book-about { max-width: 720px; }
.book-about h2 { font-size: 19px; margin: 0 0 18px; }
.book-about h3 { font-size: 16px; }
.prose { font-size: 14px; line-height: 1.75; }
.prose p { margin: 0 0 14px; }
.facts { list-style: none; padding: 0; margin: 20px 0 50px; font-size: 14px; }
.facts li { margin: 0 0 10px; }
.facts span { color: var(--link); }
.author-card { margin: 0 0 24px; }
.author-name { display: block; font-size: 17px; margin: 0 0 8px 0; }
.author-card .author-name:only-child { text-align: center; max-width: 360px; }

/* grids, listings */
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 22px 18px; margin: 10px 0 24px; }
.card { color: var(--text); display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.card:hover { text-decoration: none; }
.card .cover-frame { display: block; background: #000; border: 2px solid #444; border-radius: 5px; padding: 8px 10px; box-shadow: 0 0 0 1px #000, 0 3px 10px rgba(0,0,0,.4); transition: transform .15s; }
.card img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; }
.card:hover .cover-frame { transform: translateY(-3px); }
.card-title { font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-author { color: var(--link); font-size: 12px; }
.section-title { font-size: 21px; margin: 26px 0 6px; }
.hero { text-align: center; padding: 34px 0 16px; }
.hero h1 { font-size: 30px; margin: 0 0 6px; }
.hero p { color: var(--muted); margin: 0 0 18px; }
.hero .btn-ghost { margin-left: 10px; }
.urgency { max-width: 700px; margin: 0 auto 30px; padding: 12px 20px; text-align: center; font-size: 14px; background: var(--bg-dark); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 6px; }
.urgency strong { color: var(--warn); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.filters select, .filters input { padding: 8px; border: 0; border-radius: 2px; font-size: 14px; }
.filters button { padding: 8px 18px; border-radius: 2px; }
.pager { display: flex; justify-content: center; gap: 20px; align-items: center; margin-top: 20px; }
.intro { max-width: 760px; margin-bottom: 16px; }

/* forms, boxes */
.box { background: var(--bg-dark); border-radius: 6px; padding: 18px 22px; margin: 0 0 20px; }
.box h2 { font-size: 18px; margin: 0 0 12px; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; }
.form input[type=email], .form input[type=password], .form input[type=text], .form input:not([type]) { padding: 9px 10px; border: 0; border-radius: 3px; font-size: 15px; }
.form button { padding: 10px; border-radius: 2px; font-size: 15px; }
.price { font-size: 34px; font-weight: 600; margin: 0 0 6px; color: var(--copper); }
.perks { list-style: none; padding: 0; margin: 0 0 20px; color: var(--muted); }
.perks li::before { content: "✓ "; color: var(--ok); }

/* homepage: pitch strip + pricing plans */
.pitch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 10px 0 30px; }
.pitch .box { margin: 0; text-align: center; }
.pitch h2 { font-size: 16px; }
.pitch p { margin: 0; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 18px 0 10px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; text-align: center; border: 1px solid var(--line); }
.plan-best { border-color: var(--copper); }
.plan .badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); }
.plan h2 { font-size: 18px; margin: 6px 0 10px; }
.pill-save { display: inline-block; align-self: center; background: var(--ok); color: #0c3b27; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 8px; margin: 0 0 14px; }
.pill-placeholder { visibility: hidden; }
.plan .perks { flex: 1; }
.plan .perks { text-align: left; }
.plan .btn-subscribe { width: 100%; }
.plan .access-box { font-size: 13px; text-align: center; }

/* admin */
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 18px; }
.stats div { background: var(--bg-dark); padding: 12px 16px; border-radius: 6px; min-width: 130px; color: var(--muted); font-size: 13px; }
.stats b { display: block; font-size: 24px; color: var(--text); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table .ok { color: var(--ok); }
.actions form { display: flex; gap: 4px; margin: 0 0 4px; }
.actions select, .actions input { padding: 4px; font-size: 12px; border: 0; border-radius: 2px; }
.actions button { padding: 4px 10px; font-size: 12px; border-radius: 2px; }
.badge { background: var(--copper); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 8px; }
.report { font-size: 13px; color: var(--muted); }
code { background: rgba(0,0,0,.25); padding: 1px 4px; border-radius: 3px; font-size: 12px; }

/* footer */
.foot { background: var(--menu); margin-top: 40px; font-size: 13px; }
.foot-cols { display: flex; gap: 60px; padding-top: 36px; padding-bottom: 36px; }
.foot h4 { font-size: 15px; margin: 0 0 12px; }
.foot-cols a { display: block; margin: 0 0 6px; }
.copy { border-top: 1px solid #333; background: #2a2d33; padding: 14px 0; font-size: 12px; }

/* phone and tablet */
@media (max-width: 1000px) {
  .book-top { grid-template-columns: 240px 1fr; }
  .book-get { grid-column: 1 / -1; max-width: 420px; }
  .book-get .btn-subscribe { margin-bottom: 20px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .pitch, .plans { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .top-row { flex-direction: column; gap: 12px; }
  .search { width: 100%; }
  .logo { font-size: 28px; }
  .menu .wrap { gap: 22px; }
  .book-top { grid-template-columns: 1fr; }
  .book-cover { max-width: 300px; margin: 0 auto; }
  .book-get { max-width: none; }
  .tabs { margin-top: 30px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 18px 14px; }
  .foot-cols { flex-direction: column; gap: 24px; }
  .pitch, .plans { grid-template-columns: 1fr; }
}

/* messages (subscribers <-> team) */
.ok { color: var(--ok); }
.btn-small { padding: 4px 12px; font-size: 12px; font-weight: 500; }
.btn-ghost.is-current { background: var(--link); color: #fff; }
.conv-list tr.unread td:first-child a { font-weight: 700; }
.thread { display: flex; flex-direction: column; gap: 12px; margin: 0 0 20px; max-width: 760px; }
.msg { background: var(--bg-dark); border-radius: 6px; padding: 12px 16px; border-left: 4px solid var(--link); }
.msg.from-team { border-left-color: var(--copper); }
.msg-meta { font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.msg-meta strong { color: var(--text); }
.msg-body { line-height: 1.55; overflow-wrap: anywhere; }
.msg-compose { max-width: 760px; }
.form textarea { padding: 9px 10px; border: 0; border-radius: 3px; font: inherit; font-size: 15px; resize: vertical; }
.msg-status { margin: 12px 0 0; }
.actions .btn-small { margin: 0 0 4px; }

/* admin book editor */
.warn-text { color: var(--warn); }
.nowrap { white-space: nowrap; }
.admin-books .thumb { width: 40px; height: 60px; object-fit: cover; border-radius: 2px; background: #000; display: block; }
.admin-books td { vertical-align: middle; }
.admin-books a.btn-small:not(.btn-ghost) { color: var(--link); }
.book-form .box { max-width: 980px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid.tight { margin-top: 10px; gap: 10px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form .hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.form input[type=date], .form input[type=number] { padding: 9px 10px; border: 0; border-radius: 3px; font-size: 15px; }
.form input[type=file] { font-size: 13px; color: var(--text); }
.file-block { display: flex; gap: 16px; align-items: flex-start; }
.file-block > div { display: flex; flex-direction: column; gap: 14px; flex: 1; min-width: 0; }
.cover-preview { width: 120px; height: 180px; object-fit: cover; border-radius: 3px; background: #000; flex: none; }
.file-status { margin: 0 0 12px; }
.book-form > p .btn-save { padding: 12px 40px; font-size: 16px; }
.danger-zone { max-width: 980px; border: 1px solid #a33; }
.btn-danger { background: #b3261e !important; align-self: flex-start; padding: 9px 22px !important; }
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .file-block { flex-direction: column; }
}

/* smaller, rounded download button on the book page */
.book-get .btn-download { width: auto; min-width: 170px; padding: 8px 26px; font-size: 14px; border-radius: 999px; }

/* best-seller rows on the home page */
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 26px; }
.row-head .section-title { margin: 0 0 6px; }
.view-all { font-size: 14px; white-space: nowrap; }
@media (max-width: 1000px) { .grid.one-row > .card:nth-child(n+5) { display: none; } }
@media (max-width: 640px)  { .grid.one-row > .card:nth-child(n+5) { display: none; } }
.best-toggle .hint { display: block; margin-left: 24px; }
.home-rows { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.home-rows legend { padding: 0 6px; }
.best-toggle.home-rows .hint { display: inline; margin-left: 6px; }
