:root {
  --cream:#fff8e7; --ink:#3b2a1a; --muted:#7a6650; --barn:#b5482f; --leaf:#4f9a3d; --leaf-dark:#3f7f30; --line:#ecdcbc;
}
* { box-sizing:border-box; }
html, body { margin:0; }
body {
  min-height:100dvh; display:flex; flex-direction:column;
  background:var(--cream); color:var(--ink);
  font-family:Georgia,'Times New Roman',serif;
}
a { color:inherit; }
.top { display:flex; justify-content:flex-end; padding:14px 16px 0; }
.langs { display:flex; gap:4px; font:14px system-ui,sans-serif; }
.langs a { padding:6px 8px; border-radius:6px; color:var(--muted); text-decoration:none; }
.langs a[aria-current] { color:var(--ink); font-weight:700; }
main { flex:1; width:100%; }
.cover { position:relative; display:block; padding:0; border:0; background:none; cursor:pointer; }
.cover img { display:block; width:100%; height:auto; border-radius:12px; box-shadow:0 10px 26px rgba(59,42,26,.28); }
.peek {
  position:absolute; right:12px; bottom:12px; display:flex; align-items:center; gap:7px;
  padding:9px 13px; border-radius:999px; background:rgba(255,255,255,.96); color:var(--ink);
  font:600 14px system-ui,sans-serif; box-shadow:0 2px 8px rgba(0,0,0,.25);
}
.peek svg { width:19px; height:19px; flex:none; }
h1 { margin:0 0 6px; font-size:clamp(26px,5vw,38px); line-height:1.15; }
.by { margin:0 0 14px; font-size:16px; color:var(--muted); }
.blurb { margin:0 0 18px; font-size:17px; line-height:1.5; }
.price { font-size:30px; font-weight:bold; color:var(--barn); }
.vat { font:14px system-ui,sans-serif; color:var(--muted); }
.buy {
  display:block; width:100%; margin-top:14px; padding:15px 24px; border:0; border-radius:12px;
  background:var(--leaf); color:#fff; font:700 17px system-ui,sans-serif; text-align:center; cursor:pointer;
}
.buy { text-decoration:none; }
.buy:hover { background:var(--leaf-dark); }
.buy[disabled] { background:#b9b2a3; cursor:not-allowed; }
.noprice { font:15px system-ui,sans-serif; color:var(--muted); }
.note { margin:12px 0 0; font:14px system-ui,sans-serif; color:var(--muted); }
footer { padding:16px; border-top:1px solid var(--line); font:13px system-ui,sans-serif; color:var(--muted); text-align:center; }
footer a { margin:0 6px; }

/* A v2: everything fits on one screen; the cover takes whatever height is left */
.a2 { height:100dvh; min-height:520px; }
.a2 .top { padding:6px 12px 0; flex:none; }
.a2 main { flex:1; min-height:0; max-width:520px; margin:0 auto; padding:2px 16px 10px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
.a2 .cover { flex:1 1 0; min-height:0; width:min(72vw,300px); max-height:calc(min(72vw,300px) * 16 / 9); margin:0 0 12px; }
.a2 .cover img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:50% 78%; }
.a2 .details { flex:none; width:100%; }
.a2 h1 { font-size:clamp(23px,6vw,32px); margin-bottom:2px; }
.a2 .by { font-size:14px; margin-bottom:6px; }
.a2 .blurb { font-size:15px; line-height:1.35; margin-bottom:8px; }
.a2 .price { font-size:26px; }
.a2 .buy { margin-top:8px; padding:13px 24px; }
.a2 .note { margin-top:6px; font-size:12.5px; }
.a2 footer { flex:none; padding:8px 16px; font-size:12px; }

/* Look Inside overlay */
.lock { overflow:hidden; }
.viewer { position:fixed; inset:0; z-index:10; display:flex; flex-direction:column; background:#2b2118; }
.viewer-bar { flex:none; display:flex; justify-content:flex-end; padding:8px 12px; }
.viewer-close {
  padding:9px 16px; border:0; border-radius:999px; background:#fff; color:var(--ink);
  font:600 14px system-ui,sans-serif; cursor:pointer;
}
.viewer-pages { flex:1; min-height:0; overflow-y:auto; padding:0 12px 24px; text-align:center; }
.viewer-pages canvas { display:block; max-width:100%; height:auto; margin:0 auto 12px; background:#fff; box-shadow:0 4px 14px rgba(0,0,0,.4); }
.viewer-msg { margin:24px 0; color:#fff; font:16px system-ui,sans-serif; }
.viewer-msg a { color:#fff; }

/* Buy page */
.buy-page { min-height:max(100dvh,520px); }
.buy-page .top { flex:none; justify-content:space-between; align-items:center; padding:6px 12px 0; }
.back { padding:6px 4px; font:14px system-ui,sans-serif; color:var(--muted); text-decoration:none; }
.buy-page main { flex:1; min-height:0; max-width:460px; margin:0 auto; padding:8px 16px 12px; display:flex; flex-direction:column; justify-content:center; gap:20px; }
.buy-page main.message { gap:12px; }
.buy-page main.message p { margin:0; font-size:17px; line-height:1.5; }
.summary { display:flex; align-items:center; gap:14px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.summary img { width:68px; height:96px; object-fit:cover; object-position:50% 78%; border-radius:8px; box-shadow:0 4px 12px rgba(59,42,26,.25); flex:none; }
.summary h1 { font-size:21px; margin:0 0 2px; }
.summary .by { font-size:14px; margin:0 0 4px; }
.summary .price { font-size:22px; }
form { display:flex; flex-direction:column; gap:16px; margin:0; }
label.field { display:block; font:600 14px system-ui,sans-serif; }
input[type=email] {
  display:block; width:100%; margin-top:6px; padding:13px 12px; border:1px solid #cdbb98; border-radius:10px;
  background:#fff; color:var(--ink); font:16px system-ui,sans-serif;
}
input[type=email]:focus { outline:2px solid var(--leaf); outline-offset:1px; border-color:var(--leaf); }
input[type=email].bad { border-color:var(--barn); }
.hint { margin:-10px 0 0; font:13px system-ui,sans-serif; color:var(--muted); }
.hint.bad { color:var(--barn); }
.consent { display:flex; gap:10px; align-items:flex-start; font:14px/1.4 system-ui,sans-serif; cursor:pointer; }
.consent input { flex:none; width:22px; height:22px; margin:0; accent-color:var(--leaf); }
.buy-page .buy { margin:0; }
.buy:disabled { background:#cfc5ae; color:#fff; cursor:not-allowed; }
.secure { margin:0; font:12.5px/1.4 system-ui,sans-serif; color:var(--muted); text-align:center; }
.buy-page footer { flex:none; padding:8px 16px; font-size:12px; }

/* Confirmation page */
.confirm { min-height:max(100dvh,520px); }
.confirm .top { flex:none; padding:6px 12px 0; }
.confirm main { flex:1; min-height:0; max-width:460px; margin:0 auto; padding:8px 20px 12px; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; }
.confirm section { width:100%; }
.badge { display:flex; align-items:center; justify-content:center; width:64px; height:64px; margin:0 auto 14px; border-radius:50%; color:#fff; }
.badge svg { width:34px; height:34px; }
.badge.ok { background:var(--leaf); }
.badge.wait { background:#d99a1c; }
.badge.stop { background:#9a8c76; }
.badge.err { background:var(--barn); }
.confirm h1 { font-size:clamp(24px,6vw,30px); margin-bottom:8px; }
.lead { margin:0 0 16px; font-size:17px; line-height:1.4; }
.lead b { overflow-wrap:anywhere; }
.box { margin:0 0 16px; padding:13px 14px; border:1px solid var(--line); border-radius:12px; background:#fff; text-align:left; font:14px/1.45 system-ui,sans-serif; }
.box p { margin:0; }
.box p + p { margin-top:8px; }
.small { margin:0 0 6px; font:13px/1.45 system-ui,sans-serif; color:var(--muted); }
.small a { color:var(--ink); }
.small.gap { margin-top:12px; }
.confirm .buy { text-decoration:none; }
.confirm footer { flex:none; padding:8px 16px; font-size:12px; }

.legal main { flex:1; max-width:640px; margin:0 auto; padding:8px 20px 24px; font:16px/1.55 Georgia,serif; }
.legal h1 { font-size:26px; margin:8px 0 4px; }
.legal h2 { font-size:18px; margin:22px 0 6px; }
.legal p { margin:0 0 10px; overflow-wrap:anywhere; }
.legal p.small { margin-bottom:6px; }
