/* Central Baptist Church Public Christian Library
   Brand: the church logo's lime cross and arc, white on black, with a deeper green for text and buttons.
   Type: Montserrat (close to the logo's lettering) for headings; Atkinson Hyperlegible for reading and forms. */

:root {
  --page: #F5F7F3;
  --surface: #FFFFFF;
  --ink: #161A17;
  --ink-soft: #4B574D;
  --black: #000000;
  --green: #2E7D32;
  --green-deep: #1B4D1F;
  --green-hover: #256A29;
  --sage: #E8F2E2;
  --sage-deep: #D3E7C8;
  --line: #CBD8C6;
  --gilt: #8CC63F;
  --gilt-light: #C6EB8A;
  --focus: #3F8F22;
  --danger: #9B3426;
  --danger-bg: #F7E3DF;
  --warn: #7A4F00;
  --warn-bg: #FBEFD3;
  --ok: #24603A;
  --ok-bg: #DFEEE3;
  --info: #23395A;
  --info-bg: #E2EAF4;
  --radius: 6px;
  --serif: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --sans: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: var(--green); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--green-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; color: var(--green-deep); }
h1 { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.4rem); letter-spacing: -0.015em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.9em; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.9rem; }
.big { font-size: 1.2rem; font-family: var(--serif); font-weight: 600; margin-bottom: 0.3em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
.hp { position: absolute; left: -5000px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 32px 20px 56px; }
.wrap.wide { max-width: 1280px; }
.narrow { max-width: 620px; }

/* ---------- Masthead ---------- */
.masthead { background: var(--black); color: #fff; border-bottom: 3px solid var(--gilt); position: sticky; top: 0; z-index: 20; }
.masthead-inner {
  max-width: 1280px; margin: 0 auto; padding: 10px 20px;
  display: grid; grid-template-columns: 1fr minmax(240px, 420px) 1fr; align-items: center; gap: 16px;
}
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; justify-self: start; }
.brand img { height: 46px; width: auto; }
.brand-label { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; letter-spacing: 0.02em; color: var(--gilt-light); padding-left: 12px; border-left: 1px solid rgba(255,255,255,0.35); }
.brand:hover .brand-label { color: #fff; }
.ask { display: flex; justify-self: center; width: 100%; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.ask input { flex: 1; min-width: 0; border: 0; padding: 9px 12px; font: inherit; font-size: 1rem; color: var(--ink); background: transparent; }
.ask input:focus { outline: none; }
.ask:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.ask button { border: 0; background: var(--gilt); color: #000; font: inherit; font-weight: 700; padding: 0 16px; cursor: pointer; }
.ask button:hover { background: var(--gilt-light); }
.main-nav { justify-self: end; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.main-nav a, .main-nav .linklike { color: #fff; text-decoration: none; padding: 8px 10px; border-radius: var(--radius); font-size: 1rem; }
.main-nav a:hover, .main-nav .linklike:hover { background: rgba(255,255,255,0.12); color: #fff; }
.main-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gilt-light); border-radius: 0; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; color: inherit; }
form.inline { display: inline; margin: 0; }

/* ---------- App switcher (menu under the logo) ---------- */
.app-switch { position: relative; justify-self: start; }
.app-switch summary { list-style: none; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; color: #fff; padding: 4px 6px; margin-left: -6px; border-radius: 8px; }
.app-switch summary::-webkit-details-marker { display: none; }
.app-switch summary:hover { background: rgba(255, 255, 255, 0.08); }
.app-switch summary img { height: 46px; width: auto; }
.app-switch-caret { color: var(--gilt-light); font-size: 0.8rem; margin-left: -4px; }
.app-switch-menu { position: absolute; left: 0; top: calc(100% + 8px); z-index: 50; width: 290px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25); padding: 6px; }
.app-switch-menu a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.app-switch-menu a:hover { background: var(--sage); color: var(--ink); }
.app-switch-menu a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gilt); }
.app-switch-menu strong { font-family: var(--serif); color: var(--green-deep); }
.app-switch-menu span { font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- Ask panel ---------- */
.ask-panel { background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: 0 10px 30px rgba(20, 50, 31, 0.18); }
.ask-panel-inner { max-width: 760px; margin: 0 auto; padding: 14px 20px 18px; max-height: min(70vh, 640px); overflow-y: auto; }
.ask-head { display: flex; align-items: baseline; gap: 12px; }
.ask-q { flex: 1; margin: 0; font-style: italic; color: var(--ink-soft); }
.ask-collapse { background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 10px; font: inherit; font-size: 0.9rem; cursor: pointer; color: var(--green); }
.ask-collapse:hover { border-color: var(--green); }
.ask-panel.collapsed #ask-body { display: none; }
.ask-panel.collapsed .ask-panel-inner { padding-bottom: 12px; }
.ask-answer { font-size: 1.1rem; margin: 10px 0 12px; }
.ask-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ask-results a { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.ask-results a:hover, .ask-results a:focus-visible { background: var(--sage); }
.ask-results .t { font-family: var(--serif); font-weight: 600; color: var(--green-deep); display: block; }
.ask-results .a { font-size: 0.9rem; color: var(--ink-soft); }
.ask-thumb { width: 40px; height: 56px; border-radius: 2px; object-fit: cover; background: var(--spine, var(--green)); box-shadow: inset 3px 0 0 rgba(0,0,0,0.18); }
.ask-note { font-size: 0.82rem; color: var(--ink-soft); margin: 12px 0 0; }
.ask-loading { color: var(--ink-soft); }

/* ---------- Search suggestions ---------- */
.suggest-wrap { position: relative; }
.suggest-box {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 300px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18); max-height: min(70vh, 520px); overflow-y: auto; padding: 6px; text-align: left;
}
.ask .suggest-box { top: calc(100% + 6px); }
.suggest-label { margin: 6px 8px 2px; font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); }
.suggest-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.suggest-item:hover, .suggest-item.is-active { background: var(--sage); color: var(--ink); }
.suggest-thumb { width: 32px; height: 46px; border-radius: 2px; object-fit: cover; background: var(--spine, var(--green)); box-shadow: inset 3px 0 0 rgba(0, 0, 0, 0.2); display: block; }
.suggest-icon { width: 32px; text-align: center; color: var(--green); font-size: 1.05rem; }
.suggest-small { padding-top: 4px; padding-bottom: 4px; }
.suggest-text { display: grid; min-width: 0; }
.suggest-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-meta { font-size: 0.85rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-item mark { background: var(--gilt-light); color: inherit; border-radius: 2px; padding: 0 1px; }
.suggest-item .avail { font-size: 0.78rem; }
.suggest-empty, .suggest-foot { margin: 6px 8px; font-size: 0.85rem; color: var(--ink-soft); }
.suggest-foot { border-top: 1px solid #E3E9E5; padding-top: 8px; }

/* ---------- Sortable table headers ---------- */
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { color: var(--green); text-decoration: underline; }
.sort-link.is-active { color: var(--green-deep); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0.55em 1.1em; border-radius: var(--radius);
  background: var(--green); color: #fff; border: 1px solid var(--green);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: var(--green-hover); color: #fff; text-decoration: none; }
.btn-quiet { background: var(--surface); color: var(--green); border-color: var(--line); }
.btn-quiet:hover { background: var(--sage); color: var(--green-deep); border-color: var(--green); }
.btn-small { min-height: 36px; padding: 0.35em 0.8em; font-size: 0.92rem; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #7E2A1F; }
.actions, .quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.quick { margin-bottom: 24px; }

/* ---------- Flash ---------- */
.flashes { margin-bottom: 20px; display: grid; gap: 8px; }
.flash { margin: 0 0 12px; padding: 12px 16px; border-radius: var(--radius); border-left: 4px solid; }
.flashes .flash { margin: 0; }
.flash-ok { background: var(--ok-bg); border-color: var(--ok); }
.flash-error { background: var(--danger-bg); border-color: var(--danger); }

/* ---------- Hero & shelf ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: end; padding: 24px 0 40px; }
.hero h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); line-height: 1.08; max-width: 14ch; }
.lede { font-size: 1.2rem; line-height: 1.6; color: var(--ink-soft); max-width: 46ch; }
.hero .actions { margin: 24px 0 12px; }
.hero-count { color: var(--ink-soft); font-size: 0.95rem; }

.shelf { display: flex; align-items: flex-end; gap: 3px; padding: 0 10px; min-height: 230px; overflow: hidden; }
.spine {
  flex: none; width: var(--w, 40px); height: var(--h, 180px);
  background:
    linear-gradient(to bottom, transparent 14px, var(--gilt-light) 14px, var(--gilt-light) 16px, transparent 16px, transparent 20px, var(--gilt-light) 20px, var(--gilt-light) 21px, transparent 21px),
    linear-gradient(to top, transparent 14px, var(--gilt-light) 14px, var(--gilt-light) 16px, transparent 16px),
    linear-gradient(to right, rgba(255,255,255,0.10), transparent 30%, transparent 70%, rgba(0,0,0,0.22)),
    var(--spine, var(--green));
  border-radius: 3px 3px 1px 1px;
  display: flex; align-items: center; justify-content: center;
  padding: 26px 0; text-decoration: none; color: #FFFFFF;
  transform-origin: bottom left; transition: transform 0.18s ease;
}
a.spine:hover, a.spine:focus-visible { transform: translateY(-8px); color: #fff; }
.spine-tilt { transform: rotate(-6deg); margin-left: 10px; margin-right: 4px; }
a.spine-tilt:hover { transform: rotate(-6deg) translateY(-8px); }
.spine-title {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--serif); font-weight: 600; font-size: 0.74rem; line-height: 1.1; letter-spacing: 0.03em;
  max-height: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shelf-board { height: 14px; background: linear-gradient(var(--gilt) 0 3px, var(--black) 3px); border-radius: 0 0 3px 3px; box-shadow: 0 6px 12px rgba(20, 50, 31, 0.18); }

/* ---------- Kids & Teens ---------- */
.ministries { padding: 36px 0; border-top: 1px solid var(--line); }
.ministry-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 8px; }
.ministry-card { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; text-decoration: none; color: var(--ink); }
.ministry-card:hover { border-color: var(--green); box-shadow: 0 6px 18px rgba(27, 77, 31, 0.12); color: var(--ink); }
.ministry-card img { width: 100%; max-width: 360px; height: auto; margin: 0 auto; }
.ministry-card span { text-align: center; font-weight: 700; color: var(--green); }
.audience-banner { display: flex; align-items: center; gap: 20px; margin-bottom: 8px; }
.audience-banner img { width: 220px; height: auto; }

/* ---------- Landing sections ---------- */
.how, .cats, .visit { padding: 36px 0; border-top: 1px solid var(--line); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; }
.steps h3::before { content: counter(step); display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; margin-right: 0.5em; border: 1.5px solid var(--gilt); border-radius: 50%; font-size: 0.9em; color: var(--green); }
.cat-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cat-list a { display: inline-block; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.cat-list a:hover { border-color: var(--green); background: var(--sage); }
.visit { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

/* ---------- Page heads, cards ---------- */
.page-head { margin-bottom: 24px; }
.page-head.split { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.crumb { font-size: 0.95rem; margin-bottom: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; margin-bottom: 20px; }
.card h2 { font-size: 1.2rem; }
.card-note { border-left: 4px solid var(--green); }
.card-warn { border-left: 4px solid var(--warn); background: var(--warn-bg); }
.notice { padding-top: 24px; }
.code-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--gilt); border-radius: 8px; padding: 12px 18px; text-align: center; min-width: 180px; }
.code-card span { display: block; font-size: 0.85rem; color: var(--ink-soft); }
.code-card strong, .code-big { font-family: var(--serif); font-size: 1.7rem; letter-spacing: 0.04em; color: var(--green-deep); }
.code-big { display: block; margin: 6px 0; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; padding: 24px; }

/* ---------- Forms ---------- */
.stack { display: grid; gap: 16px; }
.stack > .btn { justify-self: start; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > .field { flex: 1 1 180px; }
.row > .field.short { flex: 0 1 130px; }
.field { display: grid; gap: 5px; align-content: start; }
.field label, .label { font-weight: 700; font-size: 0.97rem; margin: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="search"], input[type="time"], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid #A9B8AF; border-radius: var(--radius); padding: 0.6em 0.7em; min-height: 44px;
}
textarea { min-height: 0; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--green); }
input[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: 0.88rem; color: var(--ink-soft); margin: 0; }
.error { font-size: 0.9rem; color: var(--danger); margin: 0; font-weight: 700; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 400; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-family: var(--serif); font-size: 1.2rem; color: var(--green-deep); padding: 0; margin-bottom: 12px; }
fieldset.card legend { float: left; width: 100%; }
fieldset.card legend + * { clear: both; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Catalog ---------- */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 24px; }
.filters .grow { flex: 1 1 240px; }
.filters .check { min-height: 44px; }
.book-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 28px 22px; }
.book-card { display: grid; gap: 4px; align-content: start; }
.book-card-link { text-decoration: none; display: grid; gap: 10px; }
.book-card-title { font-family: var(--serif); font-weight: 600; font-size: 0.98rem; line-height: 1.25; color: var(--green-deep); }
.book-card-link:hover .book-card-title { text-decoration: underline; }
.book-card-author { font-size: 0.92rem; color: var(--ink-soft); }

.cover { aspect-ratio: 2 / 3; width: 100%; border-radius: 2px 4px 4px 2px; object-fit: cover; background: var(--sage-deep); box-shadow: 0 1px 2px rgba(0,0,0,0.12), 0 6px 14px rgba(20, 50, 31, 0.12); }
.cover-sm { width: 44px; flex: none; }
.cover-xs { width: 30px; flex: none; }
.cover-lg { width: 100%; max-width: 280px; }
.cover-gen {
  background: var(--spine); color: #FFFFFF; display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: 14% 12%; text-align: center; position: relative; overflow: hidden;
  box-shadow: inset 6px 0 0 rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.12), 0 6px 14px rgba(20, 50, 31, 0.12);
}
.cover-gen::after { content: ''; position: absolute; inset: 7% 9%; border: 1px solid rgba(198, 235, 138, 0.55); pointer-events: none; }
.cover-gen-title { font-family: var(--serif); font-weight: 600; font-size: 0.95rem; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
.cover-gen-author { font-size: 0.75rem; opacity: 0.85; }
.cover-sm.cover-gen, .cover-xs.cover-gen { padding: 0; }
.cover-sm .cover-gen-title, .cover-sm .cover-gen-author, .cover-xs .cover-gen-title, .cover-xs .cover-gen-author { display: none; }
.cover-lg .cover-gen-title { font-size: 1.4rem; }
.cover-lg .cover-gen-author { font-size: 0.95rem; }
.cover-empty { display: grid; place-items: center; color: var(--ink-soft); font-size: 0.9rem; box-shadow: none; border: 1px dashed var(--line); background: var(--surface); }

.avail { font-size: 0.88rem; font-weight: 700; }
.avail::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.avail-yes { color: var(--ok); }
.avail-yes::before { background: var(--ok); }
.avail-no { color: var(--warn); }
.avail-no::before { background: transparent; border: 1.5px solid var(--warn); }
.avail-none { color: var(--ink-soft); }
.avail-none::before { background: var(--line); }

.subcats { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 24px; }
.subcats a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 0.93rem; }
.subcats a:hover { border-color: var(--green); }
.subcats a[aria-current="page"] { background: var(--green); border-color: var(--green); color: #fff; }
.subcats a[aria-current="page"] .muted { color: var(--gilt-light); }
.more-subcats { display: contents; }
.more-subcats summary { padding: 6px 12px; border: 1px dashed var(--line); border-radius: 999px; cursor: pointer; font-size: 0.93rem; color: var(--green); list-style: none; }
.more-subcats[open] summary { display: none; }
.cover-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.cover-card h2 { margin-bottom: 4px; }
.cover-card p { margin: 0; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; }

.book-detail { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 44px; align-items: start; }
.book-detail h1 { margin-bottom: 0.2em; }
.subtitle { font-size: 1.2rem; color: var(--ink-soft); margin-bottom: 0.4em; }
.byline { font-size: 1.1rem; }
.checkout-box { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin: 20px 0 24px; display: grid; gap: 10px; justify-items: start; max-width: 520px; }
.checkout-box p { margin: 0; }
.description { font-size: 1.08rem; line-height: 1.7; max-width: 68ch; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 20px 0; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; }
.facts.compact { gap: 3px 14px; font-size: 0.95rem; margin: 10px 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags a { font-size: 0.88rem; padding: 3px 10px; background: var(--sage); border-radius: 999px; text-decoration: none; }

/* ---------- Checkout / slots ---------- */
.slots { display: grid; gap: 22px; margin-bottom: 24px; }
.slots legend { font-size: 1.3rem; }
.slot-day h2 { font-size: 1.1rem; margin-bottom: 8px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; }
.slot span { display: grid; place-items: center; min-height: 48px; padding: 6px; border: 1px solid #A9B8AF; border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: center; line-height: 1.15; }
.slot small { display: block; font-size: 0.75rem; color: var(--ink-soft); }
.slot input:hover + span { border-color: var(--green); background: var(--sage); }
.slot input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.slot input:checked + span small { color: var(--gilt-light); }
.slot input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.slot-full span { background: transparent; color: var(--ink-soft); border-style: dashed; cursor: not-allowed; text-decoration: line-through; }
.code-field { max-width: 320px; margin-bottom: 20px; }

/* ---------- My Library ---------- */
.my-section { margin-bottom: 36px; }
.pickup-group { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gilt); border-radius: 8px; padding: 16px 18px; margin-bottom: 12px; }
.pickup-when p { margin: 0 0 6px; }
.line-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pickup-group .line-list { border: 0; background: transparent; gap: 10px; }
.line-list li { display: flex; gap: 14px; align-items: center; background: var(--surface); padding: 12px 14px; }
.pickup-group .line-list li { padding: 0; }
.line-list.compact li { padding: 8px 14px; }
.line-list .grow, .grow { flex: 1; min-width: 0; }
.line-list p { margin: 2px 0 0; }
.history summary { cursor: pointer; list-style: none; }
.history summary h2 { display: inline; }
.history summary::before { content: '+'; display: inline-block; width: 1.2em; color: var(--gilt); font-weight: 700; }
.history[open] summary::before { content: '–'; }
.history summary + * { margin-top: 12px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: start; }
.settings-grid .card { margin: 0; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--sage); color: var(--green-deep); white-space: nowrap; vertical-align: 1px; }
.badge-ok, .badge-approved { background: var(--ok-bg); color: var(--ok); }
.badge-warn, .badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-danger, .badge-denied { background: var(--danger-bg); color: var(--danger); }
.badge-paused { background: #ECE7F1; color: #4F3A63; }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: #ECEEEC; color: var(--ink-soft); }

/* ---------- Librarian area ---------- */
.admin { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 36px; align-items: start; }
.admin-nav { display: grid; gap: 2px; position: sticky; top: 90px; }
.admin-role { font-family: var(--serif); color: var(--ink-soft); margin: 0 0 8px 12px; }
.admin-nav a { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.admin-nav a:hover { background: var(--sage); }
.admin-nav a[aria-current="page"] { background: var(--green); color: #fff; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--gilt); color: #000; font-size: 0.8rem; font-weight: 700; }
.admin-main { min-width: 0; }
.admin-section { margin: 28px 0; }
.admin-section h2 { font-size: 1.25rem; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-soft); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--green); }
.tabs a[aria-current="page"] { color: var(--green-deep); border-bottom-color: var(--gilt); font-weight: 700; }
.table-wrap { position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.table th { text-align: left; font-weight: 700; color: var(--ink-soft); font-size: 0.88rem; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FAFBF9; }
.table td { padding: 11px 14px; border-bottom: 1px solid #E3E9E5; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.actions { white-space: nowrap; text-align: right; }
.table .avail { white-space: nowrap; }
.table tr.inactive td { color: var(--ink-soft); }
.with-cover { display: flex; gap: 10px; align-items: center; }
.toggle-card { display: flex; gap: 20px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.toggle-card h2 { margin-bottom: 4px; }
.toggle-card p { margin: 0; }
.app-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.app-list .card { margin: 0; }
.app-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 28px; align-items: start; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 20px; }
.narrow-form { max-width: 520px; }
.day-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 16px; }
.settings-form { display: grid; gap: 0; }

.book-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 36px; align-items: start; }
.book-form-side { display: grid; gap: 10px; justify-items: start; position: sticky; top: 90px; }
.cover-preview { width: 100%; }
.cover-preview .cover { max-width: 220px; }
.file-btn { cursor: pointer; }
.isbn-row { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.isbn-row .field { flex: 1 1 220px; }
.isbn-row .btn { margin-top: 28px; }

/* ---------- Book screen (familiar WordPress layout: writing area + side boxes) ---------- */
.wp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.wp-main { display: grid; gap: 18px; min-width: 0; }
.wp-side { display: grid; gap: 16px; align-content: start; }
.input-title { font-family: var(--serif); font-size: 1.5rem !important; font-weight: 600; padding: 0.5em 0.6em !important; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.box-head { font-family: var(--sans); font-size: 1rem; font-weight: 700; color: var(--ink); margin: 0; padding: 10px 14px; background: #FAFBF9; border-bottom: 1px solid var(--line); }
.box-body { padding: 14px; }
.box-body .table-wrap { border: 0; }
.box-sub { font-family: var(--sans); font-size: 0.85rem; font-weight: 700; color: var(--green); margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #E3E9E5; }
.box-sub:first-child { margin-top: 0; }
.box-body .row + .row, .box-body .isbn-row { margin-top: 12px; }
.cat-filter { margin-bottom: 8px; min-height: 38px !important; padding: 0.4em 0.6em !important; }
.cat-scroll { max-height: 280px; overflow-y: auto; border: 1px solid #E3E9E5; border-radius: 6px; padding: 8px 10px; }
.cat-scroll .check { font-size: 0.95rem; padding: 2px 0; }
.cat-scroll .check input { width: 17px; height: 17px; }
.cat-tree, .cat-tree ul { list-style: none; margin: 0; padding: 0; }
.cat-tree ul { padding-left: 22px; }
.add-cat { margin-top: 10px; }
.add-cat summary { cursor: pointer; color: var(--green); font-weight: 700; font-size: 0.95rem; }
.add-cat .stack { margin-top: 10px; gap: 10px; }
.audience-choices { display: grid; gap: 6px; }
.danger-box .box-head { color: var(--danger); }
.wp-side .btn { width: 100%; }
.wp-side .file-btn { width: auto; }
.short-desc { font-size: 1.15rem; font-style: italic; color: var(--ink-soft); margin: 4px 0 0; }
[data-show-for][hidden] { display: none; }

/* ---------- Footer ---------- */
.site-foot { border-top: 3px solid var(--gilt); background: var(--black); color: #D9E2D6; }
.site-foot .wrap { padding: 28px 20px; }
.site-foot p { margin: 0 0 4px; }
.site-foot strong { font-family: var(--serif); font-weight: 600; color: #fff; }
.foot-logo { height: 54px; width: auto; margin-bottom: 14px; }
.site-foot .muted { color: #A3B39E; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .shelf { min-height: 0; }
  .admin { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .admin-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .admin-nav a { white-space: nowrap; }
  .admin-role { display: none; }
  .two-col, .book-form-grid, .wp-layout { grid-template-columns: minmax(0, 1fr); }
  .book-form-side { position: static; }
}
@media (max-width: 760px) {
  body { font-size: 1rem; }
  .masthead { position: static; }
  .masthead-inner { grid-template-columns: 1fr auto; gap: 10px; }
  .ask { grid-column: 1 / -1; grid-row: 2; }
  .main-nav a, .main-nav .linklike { padding: 6px 8px; }
  .steps, .visit, .ministry-cards { grid-template-columns: minmax(0, 1fr); }
  .brand img, .app-switch summary img { height: 38px; }
  .audience-banner img { width: 160px; }
  .book-detail { grid-template-columns: 1fr; gap: 20px; }
  .book-detail-cover .cover { max-width: 200px; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 22px 16px; }
  .pickup-group { grid-template-columns: 1fr; }
  .spine:nth-child(n+9) { display: none; }
  .table td.actions { white-space: normal; }
}
@media (max-width: 480px) {
  .brand span { font-size: 1.05rem; }
  .main-nav { gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .masthead, .site-foot, .admin-nav, .actions, .quick, form { display: none !important; }
}
