/* Shared chrome for the site's own pages (home, account, club, privacy): the library-card
   look, light and dark. Book pages keep their own palettes. Page-specific rules stay inline. */
:root {
  --paper: #f6f1e7; --ink: #1d1a16; --muted: #6b6257; --line: #d8cfbf; --card: #fffdf8;
  --accent: #9b2c1f; --ok: #2f6b3a; --gold: #b8860b;
  --display: Fraunces, Georgia, serif; --body: "Source Serif 4", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #15130f; --ink: #f1ebdf; --muted: #a99f90; --line: #3a342b; --card: #1d1a15; --accent: #e0705f; --ok: #7fc48d; --gold: #e3b94a; color-scheme: dark; }
}
:root[data-theme="dark"] { --paper: #15130f; --ink: #f1ebdf; --muted: #a99f90; --line: #3a342b; --card: #1d1a15; --accent: #e0705f; --ok: #7fc48d; --gold: #e3b94a; color-scheme: dark; }

html, body { background: var(--paper); color: var(--ink); }
body { font-family: var(--body); font-size: 17px; line-height: 1.55; margin: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 28px 64px; }
.wrap { max-width: 44rem; margin: 0 auto; display: grid; gap: 22px; }
.stack { display: grid; gap: 22px; }
h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 7vw, 2.8rem); line-height: 1.05; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 600; font-size: 1.35rem; margin: 0 0 10px; }
a { color: var(--ink); }
.lede, .sub { margin: 0; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.note { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin: 8px 0 0; }
[hidden] { display: none !important; }

/* Signed-in bar (filled by account.js) */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; font-size: 15px; }
.bar a { text-decoration: none; }
.bar .me, .bar .signin { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; margin-left: auto; }
.bar .signin { padding: 6px 14px; }
.av { border-radius: 50%; vertical-align: middle; background: #ddd; }

/* Cards, buttons, forms, messages */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.btn { font: 600 15px var(--body); color: var(--paper); background: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; padding: 9px 18px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.ghost { color: var(--ink); background: transparent; }
.btn.danger { color: var(--accent); background: transparent; border-color: var(--accent); }
.btn.small { font-size: 13px; padding: 5px 12px; }
.btn[disabled] { opacity: .5; cursor: default; }
form { display: grid; gap: 10px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; width: 100%; box-sizing: border-box; }
textarea { min-height: 84px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.msg { font-size: 14px; margin: 0; min-height: 1.2em; }
.msg.err { color: var(--accent); }
.msg.ok { color: var(--ok); }
code { font: 600 15px ui-monospace, Menlo, monospace; letter-spacing: .12em; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* Two-step confirmation: the summary is the first click, the button inside is the second. */
details.confirm > summary { list-style: none; cursor: pointer; display: inline-block; }
details.confirm > summary::-webkit-details-marker { display: none; }
details.confirm[open] > summary { display: none; }
details.confirm > div { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Book covers, as on the homepage shelf */
.cover { flex: none; width: 62px; height: 92px; border-radius: 4px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 8px 4px; text-align: center; color: #f4e9d8; font: 700 10px/1.2 var(--display); letter-spacing: .12em; text-transform: uppercase; }
.cover.small { width: 46px; height: 68px; padding: 6px 3px; font-size: 7px; letter-spacing: .1em; }
