/* Shared look for the account pages (start, dashboard). Books use their own theme in book.css. */
:root { --paper: #FBF7F0; --ink: #2B2118; --soft: #4A3E33; --muted: #6B5D50; --line: #E6DCCD; --rust: #A63D2A; --rust-d: #7E2C1E; --sage: #4F6B4C; --sage-l: #E9F0E7; --gold: #C99A4B; --warn: #8A5A00; --warn-l: #FFF4DB; --bad: #9B2C2C; --bad-l: #FBE9E7; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 'Atkinson Hyperlegible', system-ui, sans-serif; }
h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(30px, 5vw, 42px); } h2 { font-size: 26px; } h3 { font-size: 20px; }
a { color: var(--rust); } a:hover { color: var(--rust-d); }
.hand { font-family: 'Caveat', cursive; font-size: 26px; color: var(--sage); margin: 0; }
.muted { color: var(--muted); } .small { font-size: 15px; }
header.top { border-bottom: 1px solid var(--line); }
header.top .in { max-width: 1180px; margin: 0 auto; padding: 12px 24px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); font-family: 'Fraunces', Georgia, serif; font-weight: 700; font-size: 20px; min-height: 44px; }
.brand picture { display: contents; } .brand img { height: 56px; width: auto; display: block; }
main.wrap { max-width: 1180px; margin: 0 auto; padding: 32px 24px 80px; }
.narrow { max-width: 640px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.stack { display: flex; flex-direction: column; gap: 14px; } .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
label { font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 15px; }
input[type=text], input[type=email], input:not([type]), textarea, select { font: inherit; padding: 11px 13px; border: 1.5px solid #CBBFAE; border-radius: 8px; background: #fff; color: var(--ink); min-height: 46px; width: 100%; }
textarea { min-height: 120px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #2F6FB0; outline-offset: 2px; }
.btn { font: inherit; font-weight: 700; border-radius: 8px; padding: 11px 20px; min-height: 46px; cursor: pointer; border: 1.5px solid var(--rust); background: var(--rust); color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn:hover { background: var(--rust-d); border-color: var(--rust-d); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: #CBBFAE; } .btn.ghost:hover { background: #F3ECE1; color: var(--ink); }
.btn.small { padding: 6px 12px; min-height: 38px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.err { color: var(--bad); background: var(--bad-l); border-radius: 8px; padding: 10px 14px; margin: 0; }
.note { background: var(--warn-l); color: #4A3500; border-radius: 8px; padding: 10px 14px; margin: 0; }
.ok { color: var(--sage); }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #F3ECE1; color: var(--soft); }
.pill.good { background: var(--sage-l); color: #2F4A2C; } .pill.warn { background: var(--warn-l); color: var(--warn); } .pill.bad { background: var(--bad-l); color: var(--bad); }
.steps { list-style: none; margin: 0 0 24px; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.steps li { padding: 4px 12px; border-radius: 999px; background: #F3ECE1; color: var(--muted); }
.steps li[aria-current=step] { background: var(--ink); color: #fff; } .steps li.done { background: var(--sage-l); color: #2F4A2C; }
.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sw { text-align: left; border: 2px solid transparent; border-radius: 10px; padding: 10px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 6px; min-height: 96px; }
.sw[aria-pressed=true] { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.sw .dots { display: flex; gap: 4px; } .sw .dots i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.sw b { font-size: 15px; } .sw small { font-size: 13px; opacity: .85; }
details.grp > summary { cursor: pointer; font-weight: 700; padding: 8px 0; min-height: 44px; display: flex; align-items: center; }
.drop { border: 2.5px dashed #CBBFAE; border-radius: 14px; padding: 34px 20px; text-align: center; background: #fff; cursor: pointer; }
.drop.over { border-color: var(--sage); background: var(--sage-l); }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; } table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tabs button { font: inherit; font-weight: 700; background: none; border: none; border-bottom: 3px solid transparent; padding: 10px 14px; cursor: pointer; color: var(--muted); min-height: 46px; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--rust); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; } .thumbs img { width: 120px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #eee; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 600px) { main.wrap { padding: 22px 16px 60px; } .card { padding: 16px; } }
.row > select { width: auto; flex: 0 1 280px; }
.thumbs.big img { width: 260px; height: auto; max-height: 200px; object-fit: contain; background: #fff; }
@media (max-width: 600px) { .thumbs.big img { width: 100%; max-height: none; } }

.cardpic { position: relative; display: block; flex: none; align-self: flex-start; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.cardpic img { position: absolute; max-width: none; height: auto; border: 0 !important; border-radius: 0 !important; object-fit: fill !important; max-height: none !important; background: none; }
.thumbs .cardpic { width: 120px; } .thumbs.big .cardpic { width: 260px; }
@media (max-width: 600px) { .thumbs.big .cardpic { width: 100%; max-height: none; } }

/* Look & settings. Wide: words | book | style & colors, fitted to the window, each side scrolling on its own.
   Medium: words | book over picker. Phone: book, words, picker. */
.settings { display: grid; gap: 18px; align-items: start; grid-template-columns: minmax(250px, 1fr) minmax(250px, 290px) minmax(300px, 1.25fr); grid-template-areas: "words cover pick"; }
.set-cover { grid-area: cover; width: 100%; justify-self: center; align-self: start; }
.set-words { grid-area: words; } .set-pick { grid-area: pick; }
@media (min-width: 1100px) {
  .settings { height: var(--fit, 640px); }
  .set-words, .set-pick { max-height: 100%; overflow: auto; overscroll-behavior: contain; padding-bottom: 80px; }
  main.wrap:has(.settings) { padding-top: 18px; padding-bottom: 16px; }
  .tabs:has(+ [role=tabpanel] .settings) { margin-bottom: 12px; }
  .set-cover { position: sticky; top: 0; }
  .mini-cover { display: none !important; }
}
.set-words, .set-pick { padding: 16px 18px; }
.set-words.stack { gap: 10px; }
.set-words h2 { font-size: 20px; margin: 4px 0 0; }
.set-words label { font-size: 14px; gap: 4px; }
.set-words input:not([type=file]), .set-words select { min-height: 40px; padding: 7px 11px; font-size: 15px; }
.set-words .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.set-pick .stack { gap: 8px; }
.set-pick .pick-h { font-size: 17px; margin: 2px 0 0; }
.set-pick details.grp > summary { min-height: 38px; padding: 4px 0; font-size: 15px; }
.set-pick .styles { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.set-pick .sw { min-height: 70px; padding: 8px; gap: 4px; border-radius: 8px; }
.set-pick .sw b { font-size: 14px; line-height: 1.2; } .set-pick .sw small { font-size: 12px; line-height: 1.25; }
.set-pick .sw .dots i { width: 14px; height: 14px; }
.pick-h { margin: 6px 0 0; font-size: 18px; }
.mixer { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.mix { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: #fff; }
.mix input[type=color] { width: 40px; height: 40px; padding: 0; border: none; background: none; cursor: pointer; flex: none; }
.mix label { display: flex; flex-direction: column; gap: 0; font-size: 14px; } .mix small { color: var(--muted); font-size: 12px; font-weight: 400; }
.savebar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 7; width: min(560px, calc(100% - 24px)); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.savebar[hidden] { display: none; }
.savebar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.6); }
@media (max-width: 1099px) {
  .settings { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "words cover" "words pick"; }
  .set-cover { max-width: 300px; }
}
@media (max-width: 820px) {
  .settings { grid-template-columns: minmax(0, 1fr); grid-template-areas: "cover" "words" "pick"; }
  .set-cover { max-width: 260px; }
  .set-pick .styles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
.mini-cover { position: fixed; right: 16px; bottom: 84px; width: 130px; z-index: 6; pointer-events: none; filter: drop-shadow(0 8px 18px rgba(0,0,0,.25)); }
.mini-cover[hidden] { display: none; }
@media (max-width: 820px) { .mini-cover { width: 96px; right: 10px; bottom: 136px; } }
[hidden] { display: none !important; }

/* Look & settings sections, front/back switch, memorial editing */
.set-words details.sec { border-top: 1px solid var(--line); padding: 8px 0 4px; }
.set-words details.sec:first-child { border-top: 0; padding-top: 0; }
.set-words details.sec > summary { cursor: pointer; font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 19px; min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; }
.set-words details.sec > summary::-webkit-details-marker { display: none; }
.set-words details.sec > summary::after { content: "Edit ▾"; font-family: system-ui, sans-serif; font-weight: 600; font-size: 13px; color: var(--accent, #a33); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; flex: 0 0 auto; }
.set-words details.sec[open] > summary::after { content: "Close ▴"; color: inherit; opacity: .7; }
.set-words details.sec > summary:hover::after { background: #fff; }
.set-words textarea { min-height: 80px; padding: 8px 11px; font-size: 15px; font: inherit; border: 1px solid var(--line); border-radius: 10px; }
.set-words small.muted { font-size: 12.5px; font-weight: 400; }
.set-words .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.set-words .check input { width: 20px; height: 20px; min-height: 0; }
.verse-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: #fffdf8; }
.mem-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.mem-photos figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.mem-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.mem-photos input { min-height: 36px !important; font-size: 13px !important; }
.keep-photos { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.keep-photos img { aspect-ratio: 4 / 3; }
.keep-photos textarea { font-size: 13px !important; min-height: 84px; }
.flip { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.flip button { font: inherit; font-size: 13px; font-weight: 700; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 12px; min-height: 36px; cursor: pointer; }
.flip button[aria-pressed=true] { background: var(--ink); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { filter: brightness(.93); }
@media print { .mini-foot { display: none !important; } }

/* /start plan step: make "start free, pay later" impossible to miss */
.freestart { background: var(--sage-l); border: 2px solid var(--sage); border-radius: 12px; padding: 16px 20px; }
.freestart h2 { margin: 0 0 8px; font-size: 22px; color: #2F4A2C; }
.freestart p { margin: 0; }
.freestart ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.freestart li { padding-left: 28px; position: relative; line-height: 1.45; }
.freestart li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--sage); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.paylater { display: inline-block; align-self: flex-start; font-size: 14px; font-weight: 700; color: #2F4A2C; background: var(--sage-l); border-radius: 999px; padding: 3px 12px; }
