/* Layout: a publisher's catalogue — paper ground, a slim announcement band, a shelf grid of 2:3 covers; admin is a sidebar workspace. */
:root {
  --paper: #FBF8FF;
  --surface: #FFFFFF;
  --sunk: #F2EEFA;
  --ink: #1D1530;
  --muted: #625A75;
  --line: #E3DDF0;
  --sun: #FFC23D; --sky: #2F9BEF; --mint: #18B48F; --rose: #F0607F; --violet: #7A5CFA; --tang: #FF8A3D;
  --sun-soft: color-mix(in oklab, var(--sun) 24%, var(--surface));
  --sky-soft: color-mix(in oklab, var(--sky) 16%, var(--surface));
  --mint-soft: color-mix(in oklab, var(--mint) 16%, var(--surface));
  --rose-soft: color-mix(in oklab, var(--rose) 16%, var(--surface));
  --violet-soft: color-mix(in oklab, var(--violet) 14%, var(--surface));
  --tang-soft: color-mix(in oklab, var(--tang) 18%, var(--surface));
  --foot-bg: #1D1530; --foot-fg: #F4EEFF;
  --accent-base: #D9376E;
  --accent: var(--accent-base);
  --accent-soft: color-mix(in oklab, var(--accent-base) 11%, var(--surface));
  --on-accent: #FFFFFF;
  --danger: #A8321F;
  --danger-soft: color-mix(in oklab, #A8321F 10%, var(--surface));
  --ok: #2B6E45;
  --focus: color-mix(in oklab, var(--accent-base) 55%, #6FA8FF);
  --f-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #120E1C; --surface: #1B1628; --sunk: #251F35; --ink: #EEE9F7; --muted: #A69DBA; --line: #352D48; --foot-bg: #0B0814; --foot-fg: #F4EEFF;
    --accent: color-mix(in oklab, var(--accent-base) 55%, #FFFFFF);
    --accent-soft: color-mix(in oklab, var(--accent-base) 30%, var(--surface));
    --on-accent: #0F1412; --danger: #F08A78; --danger-soft: color-mix(in oklab, #F08A78 14%, var(--surface)); --ok: #7FCB9A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #120E1C; --surface: #1B1628; --sunk: #251F35; --ink: #EEE9F7; --muted: #A69DBA; --line: #352D48; --foot-bg: #0B0814; --foot-fg: #F4EEFF;
  --accent: color-mix(in oklab, var(--accent-base) 55%, #FFFFFF);
  --accent-soft: color-mix(in oklab, var(--accent-base) 30%, var(--surface));
  --on-accent: #0F1412; --danger: #F08A78; --danger-soft: color-mix(in oklab, #F08A78 14%, var(--surface)); --ok: #7FCB9A;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.mono { font-family: var(--f-mono); font-size: 0.9em; font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }

/* announcement + header */
.announce { background: var(--accent-base); color: #FFFFFF; font-size: 13.5px; }
.announce .wrap { padding-block: 8px; text-align: center; }
.site-head { background: var(--surface); }
.site-head::after { content: ""; display: block; height: 5px; background: linear-gradient(90deg, var(--rose) 0 20%, var(--tang) 20% 40%, var(--sun) 40% 60%, var(--mint) 60% 80%, var(--sky) 80% 100%); }
.brand-mark { box-shadow: 3px 3px 0 var(--sun); }
.tone-1 { --tone: var(--rose); --tone-soft: var(--rose-soft); }
.tone-2 { --tone: var(--sky); --tone-soft: var(--sky-soft); }
.tone-3 { --tone: var(--sun); --tone-soft: var(--sun-soft); }
.tone-4 { --tone: var(--mint); --tone-soft: var(--mint-soft); }
.tone-5 { --tone: var(--violet); --tone-soft: var(--violet-soft); }
.tone-6 { --tone: var(--tang); --tone-soft: var(--tang-soft); }
.services-list > div:nth-child(6n+1), .values > div:nth-child(6n+1), .stat:nth-child(6n+1), .chip:nth-child(6n+1) { --tone: var(--rose); --tone-soft: var(--rose-soft); }
.services-list > div:nth-child(6n+2), .values > div:nth-child(6n+2), .stat:nth-child(6n+2), .chip:nth-child(6n+2) { --tone: var(--sky); --tone-soft: var(--sky-soft); }
.services-list > div:nth-child(6n+3), .values > div:nth-child(6n+3), .stat:nth-child(6n+3), .chip:nth-child(6n+3) { --tone: var(--sun); --tone-soft: var(--sun-soft); }
.services-list > div:nth-child(6n+4), .values > div:nth-child(6n+4), .stat:nth-child(6n+4), .chip:nth-child(6n+4) { --tone: var(--mint); --tone-soft: var(--mint-soft); }
.services-list > div:nth-child(6n+5), .values > div:nth-child(6n+5), .stat:nth-child(6n+5), .chip:nth-child(6n+5) { --tone: var(--violet); --tone-soft: var(--violet-soft); }
.services-list > div:nth-child(6n+6), .values > div:nth-child(6n+6), .stat:nth-child(6n+6), .chip:nth-child(6n+6) { --tone: var(--tang); --tone-soft: var(--tang-soft); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; flex-wrap: wrap; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 4px; background: var(--accent-base); display: grid; place-items: center; color: #FFFFFF; font-family: var(--f-display); font-size: 19px; font-style: italic; }
.brand-name { font-family: var(--f-display); font-size: 22px; font-weight: 500; }
.nav { display: flex; gap: 4px; overflow-x: auto; max-width: 100%; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: var(--r); white-space: nowrap; font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--sunk); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }

/* buttons + forms */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; padding: 9px 16px; border-radius: var(--r); cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 45%, var(--line)); }
.btn.danger.solid { background: var(--danger); color: var(--surface); border-color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 13.5px; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label { font-weight: 600; font-size: 14px; display: block; }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.field { display: grid; gap: 6px; min-width: 0; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[type=color] { width: 56px; height: 38px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 3px; }
.req { color: var(--danger); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.errors { border: 1px solid color-mix(in oklab, var(--danger) 50%, var(--line)); background: var(--danger-soft); color: var(--ink); border-radius: var(--r); padding: 12px 16px; }
.errors strong { color: var(--danger); }
.errors ul { margin: 6px 0 0; padding-left: 20px; }
.notice { border: 1px solid var(--line); background: var(--sunk); border-radius: var(--r); padding: 10px 14px; font-size: 14px; }

/* covers */
.cover { container-type: inline-size; position: relative; aspect-ratio: 2 / 3; width: 100%; max-width: 100%; border-radius: 3px 5px 5px 3px; overflow: hidden; background: var(--sunk); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 8px 18px -10px rgb(0 0 0 / 0.35); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 4%; background: linear-gradient(90deg, rgb(0 0 0 / 0.18), rgb(0 0 0 / 0)); pointer-events: none; }
.gen-cover { position: absolute; inset: 0; background: var(--c1); color: var(--c2); display: flex; flex-direction: column; padding: 10cqw 9cqw; gap: 5cqw; }
.gen-cover .gc-rule { height: 1.5cqw; background: var(--c3); width: 30%; }
.gen-cover .gc-title { font-family: var(--f-display); font-size: 11.5cqw; line-height: 1.08; font-weight: 500; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.gen-cover .gc-auth { font-size: 6.2cqw; opacity: 0.88; margin-top: auto; }
.gen-cover .gc-pub { font-size: 4.6cqw; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.7; }

/* home */
.hero-band { background:
    radial-gradient(circle at 88% 18%, var(--sun-soft) 0 16%, transparent 16.5%),
    radial-gradient(circle at 62% 92%, var(--mint-soft) 0 12%, transparent 12.5%),
    radial-gradient(circle at 4% 100%, var(--sky-soft) 0 14%, transparent 14.5%),
    var(--rose-soft); }
.hero h1 em:nth-of-type(2n) { color: var(--violet); }
.hero-stack a { display: block; transition: transform .2s; }
.hero-stack a:nth-child(1) .cover { transform: rotate(-4deg); box-shadow: 8px 8px 0 var(--sky); }
.hero-stack a:nth-child(2) .cover { box-shadow: 8px 8px 0 var(--sun); }
.hero-stack a:nth-child(3) .cover { transform: rotate(4deg); box-shadow: 8px 8px 0 var(--mint); }
.hero { padding-block: 56px 48px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(36px, 5.4vw, 60px); font-weight: 400; }
.hero h1 em, .hl { font-style: italic; color: var(--accent); }
.hero p { font-size: 18px; color: var(--muted); max-width: 52ch; margin-top: 18px; }
.hero .btn-row { margin-top: 26px; }
.hero-stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; }
.hero-stack a:nth-child(2) { transform: translateY(-18px); }
.section { padding-block: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.section-head h2 { font-size: 30px; text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 0.2em; text-underline-offset: 0.08em; text-decoration-skip-ink: none; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 28px 22px; }
.book-card { text-decoration: none; color: var(--ink); display: grid; gap: 10px; align-content: start; min-width: 0; }
.book-card:hover .bc-title { color: var(--accent); }
.bc-title { font-family: var(--f-display); font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.bc-auth { font-size: 13.5px; color: var(--muted); }
.bc-meta { font-size: 12.5px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); letter-spacing: 0.02em; }
.pill.new { background: var(--sun); color: #2A1E00; }
.book-card .cover { transition: transform .2s; }
.book-card:hover .cover { transform: translateY(-4px) rotate(-1deg); }
.band { background: var(--violet-soft); }
.services-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.services-list > div { padding: 20px; border-radius: 12px; background: var(--tone-soft, var(--surface)); border-top: 5px solid var(--tone, var(--accent)); display: grid; gap: 6px; align-content: start; }
.services-list h3 { font-size: 21px; }

/* page header */
.page-head { margin-block: 26px 28px; padding: 36px max(20px, 4%); border-radius: 16px; display: grid; gap: 10px;
  background: radial-gradient(circle at 92% 30%, var(--sun-soft) 0 18%, transparent 18.5%), linear-gradient(120deg, var(--rose-soft), var(--violet-soft) 55%, var(--sky-soft)); }
.page-head h1 { font-size: clamp(32px, 4.4vw, 46px); font-weight: 400; }
.page-head p { color: var(--muted); font-size: 17px; max-width: 60ch; }
.prose { max-width: 66ch; display: grid; gap: 16px; font-size: 16.5px; }
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.values > div { border-top: 5px solid var(--tone, var(--accent)); background: var(--tone-soft, var(--surface)); border-radius: 0 0 12px 12px; padding: 16px 18px 18px; display: grid; gap: 6px; align-content: start; }
.values h3 { font-size: 20px; }

/* catalogue */
.filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; padding: 16px; background: var(--sky-soft); border-radius: 12px; }
.result-count { margin: 18px 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }

/* book page */
.crumbs { font-size: 13.5px; color: var(--muted); padding-block: 22px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs span[aria-current] { color: var(--ink); overflow-wrap: anywhere; }
.book-layout { display: grid; grid-template-columns: minmax(200px, 320px) minmax(0, 1fr); gap: 44px; padding-block: 26px 40px; align-items: start; }
.book-aside { display: grid; gap: 14px; }
.book-aside .btn { justify-content: center; }
.book-main { display: grid; gap: 14px; min-width: 0; }
.book-main h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 400; overflow-wrap: anywhere; }
.book-authors { font-size: 18px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 13px; padding: 4px 12px; border: 1.5px solid var(--tone, var(--line)); border-radius: 999px; background: var(--tone-soft, var(--surface)); font-weight: 500; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 14px; overflow-x: auto; }
.tabs button { font: inherit; font-weight: 600; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab-panel { padding-top: 18px; }
.desc { white-space: pre-line; font-size: 16.5px; max-width: 68ch; overflow-wrap: anywhere; }
.toc { margin: 0; padding-left: 28px; display: grid; gap: 8px; max-width: 68ch; }
.toc > li::marker { font-family: var(--f-mono); color: var(--muted); font-size: 0.9em; }
.toc ul { margin: 6px 0 2px; padding-left: 18px; list-style: none; display: grid; gap: 4px; color: var(--muted); }
.toc ul li::before { content: "– "; }
.details-table { border-collapse: collapse; width: 100%; max-width: 620px; }
.details-table th, .details-table td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.details-table th { width: 38%; font-weight: 600; color: var(--muted); font-size: 14px; }
.details-table td { overflow-wrap: anywhere; }

/* contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 40px; padding-bottom: 40px; }
.contact-details { display: grid; gap: 18px; align-content: start; }
.contact-details dd { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.contact-details dt { font-size: 12px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.form-stack { display: grid; gap: 16px; }

/* footer */
.site-foot { background: var(--foot-bg); color: var(--foot-fg); margin-top: 40px; }
.site-foot::before { content: ""; display: block; height: 5px; background: linear-gradient(90deg, var(--sky) 0 20%, var(--mint) 20% 40%, var(--sun) 40% 60%, var(--tang) 60% 80%, var(--rose) 80% 100%); }
.site-foot .muted, .site-foot .eyebrow { color: color-mix(in oklab, var(--foot-fg) 68%, var(--foot-bg)); }
.site-foot h3 { color: var(--sun); }
.site-foot .wrap { padding-block: 32px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 28px; font-size: 14px; }
.site-foot h3 { font-size: 18px; margin-bottom: 6px; }
.site-foot .fine { grid-column: 1 / -1; border-top: 1px solid color-mix(in oklab, var(--foot-fg) 18%, var(--foot-bg)); padding-top: 16px; color: color-mix(in oklab, var(--foot-fg) 68%, var(--foot-bg)); font-size: 13px; }
.site-foot a { color: var(--foot-fg); }

/* admin */
.admin { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; padding-left: max(14px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 18px; }
.admin-side nav { display: grid; gap: 2px; }
.admin-side nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r); text-decoration: none; color: var(--muted); font-weight: 500; }
.admin-side nav a:hover { background: var(--sunk); color: var(--ink); }
.admin-side nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); }
.count-badge { background: var(--accent); color: var(--on-accent); border-radius: 999px; font-size: 11.5px; font-weight: 600; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.admin-main { padding-block: 28px 60px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); min-width: 0; display: grid; gap: 22px; align-content: start; max-width: 1040px; }
.admin-main > h1 { font-size: 32px; font-weight: 400; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--tone-soft, var(--surface)); border-top: 5px solid var(--tone, var(--accent)); border-radius: 10px; padding: 16px; display: grid; gap: 2px; }
.admin-side nav a::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--dot, var(--line)); flex: none; order: -1; }
.admin-side nav a > span:first-child { flex: 1; }
.admin-side nav a:nth-child(1) { --dot: var(--rose); } .admin-side nav a:nth-child(2) { --dot: var(--sky); } .admin-side nav a:nth-child(3) { --dot: var(--sun); }
.admin-side nav a:nth-child(4) { --dot: var(--mint); } .admin-side nav a:nth-child(5) { --dot: var(--violet); } .admin-side nav a:nth-child(6) { --dot: var(--tang); }
.stat b { font-family: var(--f-display); font-size: 36px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13.5px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.table { border-collapse: collapse; width: 100%; min-width: 760px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; background: var(--sunk); }
.table tr:last-child td { border-bottom: 0; }
.table .thumb { width: 38px; }
.table a.t-title { color: var(--ink); font-weight: 600; text-decoration: none; }
.table a.t-title:hover { color: var(--accent); text-decoration: underline; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.recent { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.recent > div { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.recent > div:last-child { border-bottom: 0; }
.recent .r-title { font-weight: 600; overflow-wrap: anywhere; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 18px 20px 22px; margin: 0; display: grid; gap: 16px; min-width: 0; }
legend { font-family: var(--f-display); font-size: 20px; padding: 0 6px; }
.drop { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 16px; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; align-items: center; background: var(--surface); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.file-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.file-line .name { font-family: var(--f-mono); font-size: 13px; overflow-wrap: anywhere; }
.enq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 8px; }
.enq.unread { border-left: 3px solid var(--accent); }
.enq-head { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; align-items: baseline; }
.enq-msg { white-space: pre-line; overflow-wrap: anywhere; }
.mode-note { font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; background: var(--sunk); }
.gate { min-height: 70vh; display: grid; place-items: center; padding-block: 40px; }
.gate .card { max-width: 460px; display: grid; gap: 14px; }
.gate h1 { font-size: 30px; }
.counter { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: var(--r); font-weight: 500; box-shadow: 0 8px 24px rgb(0 0 0 / 0.25); z-index: 50; max-width: calc(100% - 32px); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-block: 36px 20px; }
  .hero-stack { max-width: 420px; }
  .book-layout { grid-template-columns: 1fr; gap: 26px; }
  .book-aside { max-width: 280px; }
  .contact-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .f-search { grid-column: 1 / -1; }
  .site-foot .wrap { grid-template-columns: 1fr; }
  .admin { grid-template-columns: 1fr; min-height: 0; }
  .admin-side { border-right: 0; border-bottom: 1px solid var(--line); padding-right: max(14px, env(safe-area-inset-right, 0px)); }
  .admin-side nav { grid-auto-flow: column; overflow-x: auto; }
  .admin-side nav a { white-space: nowrap; }
  .admin-main { padding-left: max(16px, env(safe-area-inset-left, 0px)); }
}
@media (max-width: 480px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .drop { grid-template-columns: 80px minmax(0, 1fr); }
}

/* have a manuscript */
.cta-band { position: relative; overflow: hidden; background: #1D1530; color: #FFFFFF; border-radius: 70px 24px 24px 24px; padding: clamp(28px, 5vw, 56px); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-left: clamp(0px, 9vw, 140px); }
.cta-band::after { content: ""; position: absolute; right: -60px; top: -60px; width: 230px; height: 230px; border-radius: 50%; background: var(--sun); opacity: 0.92; }
.cta-band::before { content: ""; position: absolute; right: 120px; bottom: -90px; width: 170px; height: 170px; border-radius: 50%; background: rgb(255 255 255 / 0.08); }
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { font-size: clamp(26px, 3.6vw, 38px); margin-bottom: 6px; }
.cta-band p { color: #D9D1EA; }
.cta-band .btn { background: #FFFFFF; color: #1D1530; border-color: #FFFFFF; padding: 12px 26px; }
@media (max-width: 860px) { .cta-band { margin-left: 0; border-radius: 40px 20px 20px 20px; } }
/* logo, public stats, login */
.brand-logo { height: 36px; max-width: 170px; width: auto; object-fit: contain; display: block; }
.pubstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.foot-count { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.logo-prev { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--sunk); min-height: 72px; }
.logo-prev img { max-height: 56px; max-width: 220px; object-fit: contain; }
.gate .card { box-shadow: 0 18px 50px rgb(29 21 48 / 0.14); border-top: 6px solid var(--accent); padding: clamp(24px, 4vw, 36px); text-align: center; justify-items: center; }
.gate .lock { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; font-size: 26px; }
.gate ol { text-align: left; margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- PHP version extras ---- */
.alert { border-radius: var(--r); padding: 12px 16px; font-size: 14.5px; border: 1px solid var(--line); background: var(--sunk); }
.alert.ok { border-color: var(--ok, #1c8a5a); background: color-mix(in oklab, var(--ok, #1c8a5a) 12%, var(--surface)); }
.alert.err { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 150px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.bars > div { display: grid; gap: 4px; align-items: end; justify-items: center; height: 100%; font-size: 11px; color: var(--muted); }
.bars i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars span { white-space: nowrap; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.inline-form { display: inline; }
.logout-form { margin-top: 10px; }
.cover-prev { max-width: 140px; }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; text-decoration: none; color: var(--ink); }
.pagination .cur { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.search-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* show whole cover image, never crop */
.cover > img { object-fit: contain; background: var(--sunk); }
.book-aside .cover:has(> img) { aspect-ratio: auto; }
.book-aside .cover > img { height: auto; }

/* ---- new book card ---- */
.shelf { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 24px; }
.book-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; gap: 0; align-content: stretch; grid-template-rows: auto 1fr; box-shadow: 0 1px 2px rgb(29 21 48 / 0.05); transition: transform .2s, box-shadow .2s, border-color .2s; }
.book-card:hover { transform: translateY(-5px); box-shadow: 0 16px 34px rgb(29 21 48 / 0.14); border-color: var(--tone, var(--accent)); }
.bc-stage { background: var(--tone-soft, var(--sunk)); display: grid; place-items: center; aspect-ratio: 5 / 4.4; padding: 20px; position: relative; border-bottom: 4px solid var(--tone, var(--accent)); }
.bc-stage .cover { width: 52%; max-width: 150px; box-shadow: 0 10px 22px rgb(0 0 0 / 0.28); transform: none !important; }
.bc-stage .cover:has(> img) { width: auto; max-width: 100%; height: 100%; aspect-ratio: auto; background: none; }
.bc-stage .cover > img { height: 100%; width: auto; max-width: 100%; max-height: 100%; background: none; }
.book-card:hover .cover { transform: none; }
.bc-body { padding: 14px 16px 16px; display: grid; gap: 6px; align-content: start; }
.bc-title { font-size: 19px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bc-auth { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bc-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line); }
.shelf > .book-card:nth-child(6n+1) { --tone: var(--rose); --tone-soft: var(--rose-soft); }
.shelf > .book-card:nth-child(6n+2) { --tone: var(--sky); --tone-soft: var(--sky-soft); }
.shelf > .book-card:nth-child(6n+3) { --tone: var(--sun); --tone-soft: var(--sun-soft); }
.shelf > .book-card:nth-child(6n+4) { --tone: var(--mint); --tone-soft: var(--mint-soft); }
.shelf > .book-card:nth-child(6n+5) { --tone: var(--violet); --tone-soft: var(--violet-soft); }
.shelf > .book-card:nth-child(6n+6) { --tone: var(--tang); --tone-soft: var(--tang-soft, var(--sun-soft)); }
@media (max-width: 480px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .bc-stage { padding: 12px; } .bc-title { font-size: 16px; } }

/* card fixes */
.bc-stage { aspect-ratio: auto; height: 250px; padding: 18px; }
.bc-stage .cover:has(> img) { width: auto; height: auto; max-width: 100%; aspect-ratio: auto; display: block; }
.bc-stage .cover > img { width: auto; height: auto; max-width: 100%; max-height: 214px; }
.filters { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; }
@media (max-width: 860px) { .filters { grid-template-columns: 1fr 1fr; } .filters .f-search { grid-column: 1 / -1; } }
.bc-stage .cover:has(> img), .book-aside .cover:has(> img) { container-type: normal; }
@media (max-width: 480px) { .bc-stage { height: 200px; } .bc-stage .cover > img { max-height: 170px; } }

/* covers: show the real image, no frame or bars */
.cover:has(> img) { aspect-ratio: auto; container-type: normal; background: none; }
.cover > img { height: auto; background: none; object-fit: fill; }
.hero-stack .cover:has(> img) { align-self: end; }

.book-doi{margin:14px 0 4px;font-size:1rem;color:var(--ink-2,inherit);word-break:break-all}
.book-doi a{color:var(--teal,#0b6e6e);font-weight:600;text-decoration:none}
.book-doi a:hover{text-decoration:underline}
