/* Packley web beta. Palette: paper cream, ink navy, terracotta. Contrast checked: ink on cream ~14:1, white on terracotta ~6:1. */
:root { --paper: #f6efe1; --card: #fffaf0; --ink: #14213d; --muted: #3f4a5e; --terra: #9a4527; --terra-d: #7c3519; --line: #d9ccb4; --soft: #efe4cf; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 18px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
body.scenic { background: var(--paper) url(/assets/bg-hills.jpg) center bottom / 100% auto no-repeat fixed; }
@media (max-width: 760px) { body.scenic { background-image: url(/assets/bg-cove.jpg); background-size: cover; background-attachment: scroll; background-position: center top; } }
a { color: var(--terra-d); } a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #1d5fa8; outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
h1:focus, h2:focus { outline: none; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 12px clamp(14px, 4vw, 40px); background: rgba(246, 239, 225, .92); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 24px/1 Georgia, "Times New Roman", serif; }
.brand img { border-radius: 10px; }
.badge { background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; letter-spacing: .02em; }
.top nav { margin-left: auto; display: flex; gap: 16px; } .top nav a { color: var(--ink); font-size: 16px; }
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px clamp(14px, 4vw, 40px) 40px; outline: none; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; line-height: 1.15; } h1 { font-size: clamp(30px, 5vw, 48px); margin: 6px 0 12px; } h2 { font-size: 24px; margin: 4px 0 12px; }
.tag { color: var(--terra-d); font: italic 600 19px Georgia, serif; margin: 0; }
.lead { font-size: 19px; max-width: 40em; }
#s-landing:not([hidden]) { display: grid; grid-template-columns: 1fr minmax(320px, 440px); gap: 32px; align-items: start; }
@media (max-width: 860px) { #s-landing:not([hidden]) { grid-template-columns: 1fr; gap: 12px; } .top nav { margin-left: 0; width: 100%; } }
.facts { padding-left: 20px; } .facts li { margin: 4px 0; }
.hero { background: rgba(246, 239, 225, .86); border-radius: 18px; padding: 8px 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 2px 10px rgba(20, 33, 61, .08); }
.narrow { max-width: 560px; margin: 20px auto; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input:not([type]), input[type=email], textarea { width: 100%; font: inherit; padding: 11px 12px; border: 2px solid #8f826b; border-radius: 12px; background: #fff; color: var(--ink); }
label.tick { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 16px; margin: 12px 0; }
label.tick input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--terra); }
label.optional { border-top: 1px dashed var(--line); padding-top: 12px; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
button, .btn { display: inline-block; font-family: inherit; font-size: 18px; font-weight: 600; line-height: 1.2; border: 0; border-radius: 12px; background: var(--terra); color: #fff; padding: 13px 20px; min-height: 48px; cursor: pointer; text-decoration: none; margin: 6px 6px 6px 0; }
button:hover, .btn:hover { background: var(--terra-d); } button[disabled] { opacity: .55; cursor: default; }
button.alt, .btn.alt { background: var(--soft); color: var(--ink); border: 1px solid #b9a98b; } button.alt:hover { background: #e6d8bd; }
.wide { display: block; width: 100%; margin: 16px 0 6px; }
.formmsg { min-height: 1.5em; font-size: 16px; margin: 6px 0; } .formmsg.bad { color: #8a1f11; font-weight: 600; }
.small { font-size: 15px; color: var(--muted); }
.notice { margin-top: 14px; font-size: 15px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; } .notice summary { font-weight: 700; color: var(--ink); cursor: pointer; }
.sessbar { display: inline-block; background: var(--ink); color: #fff; font-size: 15px; font-weight: 600; padding: 6px 12px; border-radius: 999px; margin-bottom: 8px; }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.book { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--card); color: var(--ink); border: 2px solid var(--line); font-weight: 400; margin: 0; padding: 16px; }
.book:hover { border-color: var(--terra); background: #fff; } .book b { font: 700 20px Georgia, serif; } .by { color: var(--muted); font-size: 15px; } .lic { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
.chathead h1 { font-size: clamp(24px, 4vw, 34px); margin-bottom: 2px; }
.log { max-width: 760px; padding-bottom: 170px; }
.msg { scroll-margin-bottom: 190px; margin: 12px 0; padding: 12px 15px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { background: #dfe7f3; margin-left: 15%; } .msg.bot { background: #fff; border: 1px solid var(--line); margin-right: 8%; } .msg.note { background: #fff3d1; font-size: 16px; }
.msg.pending { color: var(--muted); } .src { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }
.askbar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 10px clamp(12px, 4vw, 40px); }
.askbar textarea { max-width: 760px; display: block; min-height: 64px; resize: vertical; } .askbar .row { display: flex; align-items: center; flex-wrap: wrap; max-width: 760px; }
.askbar .row .small { margin-left: 8px; }
.overlay { position: fixed; inset: 0; background: rgba(12, 20, 38, .6); z-index: 50; overflow-y: auto; } .overlay[hidden] { display: none; }
.overlay .box { max-width: 520px; margin: 8vh auto; background: #fff; border-radius: 18px; padding: 24px; }
.num { display: block; font: 700 40px/1.1 Georgia, serif; color: var(--ink); text-decoration: none; margin: 10px 0; }
.foot { font-size: 14px; color: var(--muted); text-align: center; padding: 14px 16px 18px; background: rgba(246, 239, 225, .94); border-top: 1px solid var(--line); }
body.plain .foot { padding-bottom: 170px; }
.doc { max-width: 760px; margin: 0 auto; } .doc h2 { margin-top: 28px; } .doc li { margin: 4px 0; }
table { border-collapse: collapse; margin: 8px 0 18px; background: #fff; } td, th { border: 1px solid var(--line); padding: 6px 10px; text-align: left; font-size: 15px; }
body.admin form.card label { display: inline-block; margin-right: 12px; } body.admin input { width: auto; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.lines { font-size: 18px; line-height: 1.7; } .lines a { font-weight: 700; }

/* book picker: age and topic labels; study screen + quick chat buttons */
div.book { border-radius: 12px; }
.agetopic { display: flex; flex-wrap: wrap; gap: 6px; }
.agetopic .age, .agetopic .topic { font-size: 13px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.agetopic .age { background: #9a4527; color: #fff; } .agetopic .topic { background: #f1e3c8; color: #3d2a12; }
.bookgo { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.bookgo button { margin: 0; }
select#f-country{width:100%;font:inherit;padding:.5em;border-radius:8px;border:1px solid #9bb;margin-bottom:.2em}
.hint{font-size:.9em;opacity:.85;margin:.2em 0 .8em}
