/* /next/ — the overhauled Author's Helper. Bigger type than the current app on purpose (Bob: fonts bigger;
   many authors are older readers). Same colours and fonts as the current app. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #1C1917; --ink-mid: #57534E; --ink-faint: #E7E5E4; --line: #D6D3D1;
  --paper: #FAFAF9; --white: #FFFFFF;
  --accent: #336699; --accent-dark: #295680; --accent-soft: #EAF1F8;
  --good: #2F6B3A; --good-soft: #EEF4E8;
  --gold: #92741A; --gold-soft: #FBF5E6;
  --danger: #991B1B;
  --radius: 12px;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
}
html { font-size: 18px; }
body { font-family: var(--font-body); background: var(--paper); color: var(--ink); line-height: 1.6; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.9rem; margin-bottom: .6rem; }
h2 { font-size: 1.35rem; }
a { color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600;
  border-radius: var(--radius); border: 2px solid transparent; padding: .65rem 1.2rem; cursor: pointer; text-decoration: none;
  min-height: 48px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: var(--white); color: var(--accent); border-color: var(--accent); }
.btn-soft { background: var(--accent-soft); color: var(--accent-dark); }
.btn-big { font-size: 1.1rem; padding: .8rem 1.6rem; min-height: 56px; }
.btn-wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.linkbtn { background: none; border: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; padding: 0; }

/* forms */
label { display: block; font-weight: 500; margin-bottom: 1rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; font: inherit; font-weight: 400; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line); border-radius: 10px; padding: .65rem .8rem; min-height: 48px; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.hint { color: var(--ink-mid); font-size: .9rem; }
.req { color: var(--ink-mid); font-weight: 400; font-size: .9rem; }
.form-msg { color: var(--danger); margin-top: .6rem; min-height: 1.2em; }

/* sign in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin-card { width: 100%; max-width: 420px; background: var(--white); border: 1px solid var(--ink-faint); border-radius: 18px; padding: 2rem 1.6rem; text-align: center; }
.signin-card form { text-align: left; margin-top: 1.2rem; }
.signin-logo { width: 72px; height: 72px; margin-bottom: .6rem; }
.signin-foot { margin-top: 1.2rem; }
.lead-sm { color: var(--ink-mid); margin: .4rem 0 1rem; }

/* layout */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.nav { background: var(--white); border-right: 1px solid var(--ink-faint); padding: 1.2rem .8rem; display: flex; flex-direction: column; gap: .2rem;
  position: sticky; top: 0; height: 100vh; }
.nav-brand { display: flex; align-items: center; gap: .5rem; font-family: var(--font-serif); font-weight: 600; padding: 0 .6rem 1rem; }
.nav-brand img { width: 30px; height: 30px; }
.nav > a { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 1.05rem; }
.nav > a:hover { background: var(--paper); }
.nav > a.on { background: var(--accent-soft); color: var(--accent-dark); }
.ico { width: 1.4rem; text-align: center; font-size: 1.15rem; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: .4rem; padding: 0 .8rem; color: var(--ink-mid); font-size: .9rem; }
.nav-small { font-size: .9rem; }
.main { padding: 1.6rem 2.4rem 5rem; max-width: 1040px; width: 100%; }
.preview-flag { display: inline-block; background: var(--gold-soft); color: var(--gold); border-radius: 999px; padding: .2rem .8rem; font-size: .85rem; margin-bottom: 1.2rem; }
.view-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: baseline; justify-content: space-between; }
.lead { font-size: 1.1rem; color: var(--ink-mid); max-width: 44rem; margin-bottom: 1rem; }
.building { background: var(--gold-soft); color: var(--gold); border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; max-width: 44rem; }

/* home */
.greet { font-family: var(--font-serif); font-size: 1.2rem; color: var(--ink-mid); margin-bottom: .6rem; }
.nowline { background: var(--white); border: 1px solid var(--ink-faint); border-left: 6px solid var(--accent); border-radius: var(--radius); padding: 1.6rem 1.6rem; margin-bottom: 1.6rem; }
.nowline-text { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; line-height: 1.3; }
.nowline-why { color: var(--ink-mid); margin: .5rem 0 1.1rem; max-width: 40rem; }
.nowline.done { border-left-color: var(--good); }
.home-book { display: flex; gap: 1.4rem; align-items: flex-start; background: var(--white); border: 1px solid var(--ink-faint); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.8rem; }
.home-book img { width: 110px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.checks { list-style: none; margin-top: .6rem; }
.checks li { padding: .2rem 0 .2rem 1.8rem; position: relative; }
.checks li::before { content: '○'; position: absolute; left: 0; color: var(--ink-mid); }
.checks li.ok::before { content: '✓'; color: var(--good); font-weight: 700; }
.checks a { font-weight: 500; }
.soon-h { font-size: 1.1rem; margin-bottom: .5rem; }
.soon-list { padding-left: 1.2rem; color: var(--ink-mid); max-width: 44rem; }
.soon-list li { margin-bottom: .5rem; }

/* my book */
.from-biblio { background: var(--good-soft); color: var(--good); border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1.2rem; }
.book-cols { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; margin-top: 1rem; }
.pic-box { background: var(--white); border: 1px solid var(--ink-faint); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; text-align: center; }
.pic-box img { max-width: 100%; border-radius: 4px; margin-bottom: .7rem; }
.pic-box img.round, .pic-empty.round { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; margin-left: auto; margin-right: auto; }
.pic-empty { aspect-ratio: 2 / 3; display: grid; place-items: center; background: var(--paper); border: 2px dashed var(--line); border-radius: 6px; color: var(--ink-mid); margin-bottom: .7rem; }
.pic-empty.round { aspect-ratio: auto; }
.pic-box .hint { margin-top: .5rem; }
.row-btn { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin: -0.5rem 0 1rem; }
.more { background: var(--white); border: 1px solid var(--ink-faint); border-radius: var(--radius); padding: .8rem 1rem; margin: .4rem 0 1.4rem; }
.more summary { cursor: pointer; font-weight: 600; color: var(--accent-dark); padding: .2rem 0; }
.more[open] summary { margin-bottom: 1rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.formats { border: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.formats legend { font-weight: 500; margin-bottom: .3rem; }
.formats label { display: flex; align-items: center; gap: .5rem; font-weight: 400; margin: 0; }
.formats input { width: 22px; height: 22px; min-height: 0; margin: 0; }
.save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.save-state { color: var(--ink-mid); }
.save-state.ok { color: var(--good); }
.save-state.bad { color: var(--danger); }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 10px; max-width: calc(100% - 32px); z-index: 50; }

/* phones: the menu becomes a bar along the bottom */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; flex-direction: row; justify-content: space-around;
    padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--ink-faint); z-index: 20; overflow-x: auto; gap: 0; }
  .nav-brand, .nav-foot { display: none; }
  .nav > a { flex-direction: column; gap: 0; font-size: .7rem; padding: .35rem .3rem; min-width: 56px; text-align: center; }
  .nav > a .ico { font-size: 1.3rem; }
  .main { padding: 1rem 16px 7rem; }
  .book-cols { grid-template-columns: 1fr; gap: 0; }
  .book-side { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
  .grid2 { grid-template-columns: 1fr; }
  .nowline-text { font-size: 1.35rem; }
  .home-book img { width: 80px; }
  h1 { font-size: 1.6rem; }
}

/* launch kit */
.kit-wait { background: var(--accent-soft); color: var(--accent-dark); border-radius: 10px; padding: .9rem 1.1rem; margin-bottom: 1.2rem; max-width: 46rem; }
.kit-wait .btn { margin-top: .7rem; display: flex; width: max-content; }
.kit-list { display: flex; flex-direction: column; gap: .8rem; max-width: 52rem; }
.kit-card { background: var(--white); border: 1px solid var(--ink-faint); border-radius: var(--radius); }
.kit-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: left; background: none; border: 0;
  font: inherit; color: var(--ink); padding: 1rem 1.2rem; cursor: pointer; min-height: 64px; }
.kit-head b { font-size: 1.1rem; display: block; }
.kit-about { display: block; color: var(--ink-mid); font-size: .92rem; }
.kit-state { flex: none; font-size: .9rem; color: var(--ink-mid); background: var(--paper); border-radius: 999px; padding: .15rem .7rem; }
.st-done .kit-state { color: var(--good); background: var(--good-soft); }
.st-failed .kit-state { color: var(--danger); background: #FEF2F2; }
.kit-body { display: none; padding: 0 1.2rem 1.2rem; }
.kit-card.open .kit-body { display: block; }
.kit-text { min-height: 260px; }
.kit-btns { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.btn-sm { min-height: 42px; padding: .45rem .9rem; font-size: .95rem; }
.kit-err { color: var(--danger); margin-bottom: .6rem; }
.post { border: 1px solid var(--ink-faint); border-radius: 10px; padding: .8rem 1rem; margin-bottom: .7rem; }
.post-n { font-weight: 600; color: var(--ink-mid); font-size: .85rem; margin-bottom: .2rem; }
.post p { margin-bottom: .6rem; }
.spin { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.15em; margin-right: .4rem; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 820px) { .kit-head { flex-direction: column; align-items: flex-start; gap: .4rem; } }

/* posts */
.posts-list { display: flex; flex-direction: column; gap: 1rem; max-width: 52rem; }
.pcard { background: var(--white); border: 1px solid var(--ink-faint); border-radius: var(--radius); padding: 1rem 1.2rem; }
.pcard.st-skipped { opacity: .65; }
.pcard.st-posted { border-left: 5px solid var(--good); }
.st-posted .kit-state { color: var(--good); background: var(--good-soft); }
.pcard-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; font-size: 1.1rem; }
.pcard-body { display: flex; gap: 1rem; align-items: flex-start; }
.pcard-pic { width: 84px; border-radius: 4px; box-shadow: 0 1px 5px rgba(0,0,0,.15); flex: none; }
.pcard-text { margin-top: 0; }
.pcard-btns { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.pcard-after { background: var(--accent-soft); border-radius: 10px; padding: .8rem 1rem; margin-top: .8rem; }
.pcard-after p { margin-bottom: .6rem; }
.pcard-foot { margin-top: .6rem; font-size: .95rem; }
@media (max-width: 820px) { .pcard-pic { width: 60px; } }

/* readers */
.rd-card { background: var(--white); border: 1px solid var(--ink-faint); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin-bottom: 1.2rem; max-width: 52rem; }
.rd-card h2 { margin-bottom: .4rem; }
.rd-card > .hint { margin-bottom: .7rem; }
.rd-count { color: var(--ink-mid); font-weight: 400; font-size: 1rem; }
.rd-consent { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin: .8rem 0; }
.rd-consent input { width: 22px; height: 22px; min-height: 0; margin: .15rem 0 0; flex: none; }
.rd-list { list-style: none; max-height: 320px; overflow: auto; }
.rd-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px solid var(--ink-faint); }
#rd-emails .kit-card { margin-bottom: .8rem; }
#rd-emails .kit-head { cursor: default; }
.rd-sent { color: var(--good); font-weight: 600; }
.helper-note { background: var(--paper); border: 1px dashed var(--line); border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; max-width: 52rem; color: var(--ink-mid); }
.helper-note.on { border-style: solid; color: var(--good); background: var(--good-soft); border-color: transparent; }

/* the browser pop-up (Facebook / Instagram outside the Chrome family) */
.modal-back { position: fixed; inset: 0; background: rgba(28,25,23,.55); display: grid; place-items: center; padding: 16px; z-index: 60; }
.modal { background: var(--white); border-radius: 16px; padding: 1.6rem 1.6rem 1.3rem; max-width: 480px; width: 100%; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.modal h2 { margin-bottom: .6rem; }
.modal p { margin-bottom: .8rem; }
.blist { margin: 0 0 1rem 1.2rem; }
.blist li { margin-bottom: .35rem; }
.modal-btns { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .8rem; }
.helper-note.warn { background: var(--gold-soft); border: 1.5px solid #E5D3A0; color: var(--ink); }

/* the bridge to Biblio Nova — shown only for a book Biblio has not published (Bob, 2026-09-27) */
.nova-card { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; background: linear-gradient(135deg, #1E2A44 0%, #2E4468 100%);
  color: #fff; border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-bottom: 1.6rem; max-width: 52rem; }
.nova-card .nova-text { flex: 1 1 22rem; }
.nova-card h2 { color: #fff; margin-bottom: .3rem; }
.nova-card p { color: #D9E2F0; }
.nova-card .btn { background: #F2C14E; color: #1C1917; }
.nova-card .btn:hover { background: #E8B53A; }
