/* The Pro welcome (web/prowelcome.js): the opening story on a dark stage (the book by candlelight), the tour on the
   app's own parchment, the gold dots that mark what is new, and the small moment when the last one is found. */

/* ---- the gold dot: on every place a Pro feature lives, until it is tapped */
.newdot { display: inline-block; flex: none; width: 8px; height: 8px; margin: 0 0 0 7px; border-radius: 50%; vertical-align: 1px; text-indent: 0;
  background: radial-gradient(circle at 34% 30%, #f6e2a0 0%, #d6ae4c 48%, #a8822a 100%); box-shadow: 0 0 0 2.5px rgba(201, 160, 64, .22); animation: ndglow 3s ease-in-out infinite; }
@keyframes ndglow { 50% { box-shadow: 0 0 0 5px rgba(201, 160, 64, .07); } }
#loopb, .iconbtn.more { position: relative; }
#loopb > .newdot { position: absolute; top: 7px; right: 9px; margin: 0; }
.iconbtn.more > .newdot { position: absolute; top: 9px; right: 7px; margin: 0; }
.item > .newdot { margin: 0 4px 0 8px; }
.mlist button > .newdot { margin-left: auto; }
.bandstrip > .newdot { margin: 0 2px 0 6px; }
nav#nav button.hasnew::after { content: ''; position: absolute; top: 7px; left: calc(50% + 9px); width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f6e2a0 0%, #d6ae4c 48%, #a8822a 100%); box-shadow: 0 0 0 2px var(--paper); }

/* ---- You: the quiet count, and the list behind it */
.newrow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin: 2px 0 0; padding: 6px 12px 6px 16px; text-align: left; font: 500 15px/20px var(--ui); color: var(--gold-ink); -webkit-tap-highlight-color: transparent; border-radius: var(--r); }
.newrow:active { background: var(--paper-2); }
.newrow .newdot { margin: 0; }
.newrow .chev { flex: none; color: var(--muted); font-size: 20px; }
.pwl-say { margin: 2px 0 6px; }
.pwl .item > .newdot { margin: 0 14px 0 6px; }
.pwl .item.got { color: var(--muted); }
.pwl .item.got .ok-mark { margin: 0 8px 0 0; }
.pwl .item.got .t { color: var(--ink-2); }

/* ---- the last one found */
.pw-fin { position: fixed; left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 12px); z-index: 75; max-width: 420px; margin: 0 auto; cursor: pointer;
  animation: pwfin .8s cubic-bezier(.2, .7, .2, 1) both; transition: opacity .5s linear, transform .5s ease-in; }
.pw-fin.gone { opacity: 0; transform: translateY(-8px); }
@keyframes pwfin { from { opacity: 0; transform: translateY(-14px); } }
.pw-fin-in { display: flex; align-items: center; gap: 16px; padding: 14px 18px 14px 14px; background: var(--page); color: var(--ink); border: 1px solid var(--rim); border-radius: var(--r);
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px var(--fil), 0 0 0 5px rgba(233, 207, 134, .2), 0 18px 40px -16px rgba(31, 26, 21, .6); }
.pw-fin .grow { flex: 1; min-width: 0; }
.pw-fin .dp-eye { display: block; margin: 0 0 1px; animation: none; }
.pw-fin b { display: block; font: 500 22px/26px var(--display); }
.pw-fin small { display: block; font: 400 15px/20px var(--ui); color: var(--ink-2); }
.pw-medal { position: relative; flex: none; width: 56px; height: 56px; border-radius: 50%; }
.pw-medal img { display: block; width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 0 0 1px var(--rim), 0 0 0 3px var(--paper), 0 0 0 4.5px var(--gold); }
.pw-medal i { position: absolute; inset: -6px; border-radius: 50%; background: conic-gradient(from 0deg, rgba(255, 244, 204, 0) 0 62%, rgba(255, 244, 204, .95) 80%, rgba(255, 244, 204, 0) 96%);
  -webkit-mask: radial-gradient(circle, transparent 29px, #000 30px, #000 33.5px, transparent 34px); mask: radial-gradient(circle, transparent 29px, #000 30px, #000 33.5px, transparent 34px);
  opacity: 0; animation: pwturn 2.6s cubic-bezier(.4, 0, .3, 1) .5s 2 both; }
@keyframes pwturn { 0% { transform: rotate(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: rotate(360deg); opacity: 0; } }

/* One charter, one action. The welcome never waits for an animation. */
body.pw-open { overflow: hidden; }
.pw { position: fixed; inset: 0; z-index: 90; overflow: hidden; color: #493a25;
  background: radial-gradient(ellipse at 45% 25%, #fffaf0, #f5ecd7 65%, #e9d9b7);
  animation: fade .5s ease-out both; transition: opacity .4s ease-out; }
.pw.gone { opacity: 0; pointer-events: none; }
.pw-story { position: absolute; inset: 0; max-width: 500px; margin: 0 auto; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0px) 0 calc(var(--safe-b) + 4px); transition: opacity .4s ease-out; }
.pw[data-part="tour"] .pw-story { opacity: 0; pointer-events: none; }
.pw-top { flex: none; display: flex; align-items: center; height: 48px; padding: 0 12px; }
.pw-top .grow { flex: 1; }
.pw-skip, .pw-snd { min-height: 44px; color: #6d5733; border-radius: 24px; }
.pw-skip { padding: 0 12px; font: 500 14px/20px var(--ui); }
.pw-snd { flex: none; width: 44px; display: grid; place-items: center; }
.pw-skip:active, .pw-snd:active { background: #b5914b18; }
.pw-snd svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pw-snd[aria-pressed="true"] .off, .pw-snd[aria-pressed="false"] .on { display: none; }
.pw-pic { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 24px; }
.pw-charter { position: relative; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px 22px; text-align: center; border: 1px solid #bb9959; border-radius: 2px; background: #fffaf02e;
  box-shadow: 0 12px 30px -20px #74541c45; }
.charter-house { margin: 0; color: #67502d; font: 500 21px/26px var(--display); font-variant: small-caps; letter-spacing: .08em; }
.charter-house span { margin-left: 5px; color: #785b26; }
.charter-seal { position: relative; flex: none; width: 120px; height: 120px; margin: 12px 0; }
.patron-seal { display: block; width: 100%; height: 100%; overflow: visible; }
.seal-ground { fill: url(#pw-gold); filter: drop-shadow(0px 3px 2px #63451936); }
.seal-trace { fill: none; stroke: #fff3bc; stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; }
.seal-inner { fill: none; stroke: #8b662d; stroke-width: .7; }
.seal-leaf { fill: none; stroke: #735529; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.patron-seal text { font: 500 64px var(--display); fill: #76552c; paint-order: stroke; stroke: #f5dda3; stroke-width: .45px; }
.seal-star { fill: #896129; stroke: #f7e5ac; stroke-width: .6; }
.pw.run .seal-trace { animation: seal-draw 2s ease-out .2s forwards; }
@keyframes seal-draw { to { stroke-dashoffset: 0; } }
.pw-sheen { position: absolute; inset: -15px -25px; pointer-events: none; opacity: 0; background: linear-gradient(115deg, transparent 30%, #fff5c999 48%, transparent 60%); mix-blend-mode: soft-light; }
.pw.run .pw-sheen { animation: pwsheen 2.6s ease-in-out .4s both; }
@keyframes pwsheen { 0% { transform: translateX(-22%); opacity: 0; } 25%, 75% { opacity: 1; } 100% { transform: translateX(22%); opacity: 0; } }
.pw-w h1 { margin: 0 0 6px; color: #45351f; font: 500 32px/36px var(--display); text-wrap: balance; }
.pw-w p { max-width: 25em; margin: 0; color: #685637; font: 400 14px/21px var(--ui); text-wrap: balance; }
.charter-name { margin: 12px 0 0; max-width: 100%; overflow-wrap: anywhere; color: #67502d; font: italic 400 22px/28px var(--display); }
.pw-unlocks { list-style: none; padding: 0; width: 100%; margin: 18px 0 0; text-align: left; }
.pw-unlock { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid #bfa46a45; }
.pw-unlock > i { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #85662b;
  background: #d7ba7222; transition: background-color .5s ease-out, box-shadow .5s ease-out; }
.pw-unlock > i svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pw-unlock.lit > i { background: #d7ba7270; box-shadow: 0 0 12px #d2aa4222; }
.pw-unlock b { display: block; color: #45351f; font: 500 20px/23px var(--display); }
.pw-unlock small { display: block; color: #715d3d; font: 400 12px/18px var(--ui); }
.charter-sign { width: 100%; margin-top: 12px; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #bfa46a70; text-align: left; }
.charter-sign > span:first-child { color: #715b31; font: 400 10px/15px var(--ui); }
.charter-sign small { display: block; color: #715b31; font: 400 12px/18px var(--display); }
.charter-script { flex: none; color: #805b29; font: italic 20px/26px var(--display); }
.pw-foot { flex: none; padding: 14px 24px 0; display: grid; }
.pw .pw-go { min-height: 50px; width: 100%; text-align: center; color: #3d2b12; background: linear-gradient(#e8ce8b, #d5b46b); border: 1px solid #ac853b;
  font-weight: 600; box-shadow: 0 8px 22px -15px #76521880; }
.pw-go:active { background: #d5b46b; }
.pw-explore { min-height: 44px; color: #70562b; font: 400 14px/20px var(--ui); text-align: center; }
.pw-explore span { margin-left: 4px; }
/* ---- the tour: on the app's own parchment, rising over the stage */
.pw-tour { position: absolute; inset: 0; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); color: var(--ink);
  background: radial-gradient(120% 90% at 50% 0%, #fbf7ec 0%, #f6f1e4 55%, #efe7d4 100%); opacity: 0; transform: translateY(26px); pointer-events: none;
  transition: opacity .7s ease .15s, transform .9s cubic-bezier(.2, .7, .2, 1) .15s; }
.pw[data-part="tour"] .pw-tour { opacity: 1; transform: none; pointer-events: auto; }
.pw-thead { flex: none; display: flex; align-items: flex-start; gap: 6px; padding: 18px 8px 2px var(--m); }
.pw-thead .grow { flex: 1; min-width: 0; }
.pw-thead .dp-eye { margin: 0 0 2px; animation: none; }
.pw-thead h1 { font: 500 30px/34px var(--display); text-wrap: balance; outline: none; }
.pw-tbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px var(--m) 8px; }
.pw-tbody .show { margin-top: 6px; }
.pw-dots { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 0; padding: 12px 0 0; border-top: 1px solid var(--rule); font: var(--t-body); color: var(--ink-2); text-wrap: pretty; }
.pw-dots .newdot { margin: 7px 0 0 2px; }
.pw-tfoot { flex: none; padding: 6px var(--m) calc(var(--safe-b) + 10px); display: grid; gap: 2px; }
.pw-tfoot .btn.quiet { min-height: 46px; }
.pw-done.away { visibility: hidden; }


/* The mark survives the welcome while the signed paid entitlement is active. */
.patron-mark { display: flex; align-items: center; gap: 11px; padding: 12px 16px; margin: 10px 0 13px; border: 1px solid #bb9d5847; border-radius: 5px; background: linear-gradient(95deg, #dbc17d13, #f7e9bd38 50%, #dbc17d13); color: var(--gold-ink); text-align: left; }
.patron-mini { display: block; flex: none; width: 32px; height: 32px; }
.patron-mark .seal-trace { stroke-dashoffset: 0; }
.patron-mark b { display: block; font: 500 17px/21px var(--display); }
.patron-mark small { display: block; margin-top: 2px; font: 400 11px/16px var(--ui); color: var(--muted); }
body:has(.patron-mark) #nav [data-go="you"] { color: var(--gold-ink); }
.pw-eye { margin: 0 0 6px; font: 600 16px/20px var(--display); font-variant: all-small-caps; letter-spacing: .12em; color: #785b26; }
.pw-just-opened .sh-ui { animation: patron-unlock 1s ease-out; }
@keyframes patron-unlock { from { box-shadow: 0 0 0 1px #d2b56b; } to { box-shadow: 0 0 0 1px transparent; } }
@media (max-height: 720px) {
  .pw-top { height: 44px; }
  .pw-charter { padding: 12px 18px; }
  .charter-house { font-size: 18px; line-height: 22px; }
  .charter-seal { width: 82px; height: 82px; margin: 7px 0; }
  .pw-w h1 { font-size: 28px; line-height: 31px; }
  .pw-w p { font-size: 12px; line-height: 18px; }
  .charter-name { margin-top: 8px; font-size: 20px; line-height: 24px; }
  .pw-unlocks { margin-top: 12px; }
  .pw-unlock { padding: 6px 0; }
  .pw-unlock b { font-size: 18px; line-height: 21px; }
  .pw-unlock small { font-size: 11px; line-height: 16px; }
  .charter-sign { margin-top: 8px; padding-top: 8px; }
  .charter-sign small { font-size: 11px; line-height: 16px; }
  .charter-script { font-size: 18px; }
  .pw-foot { padding-top: 10px; }
}
.pw.calm, .pw.calm * { animation: none !important; transition: none !important; }
.pw.calm .pw-sheen { display: none; }
.pw.calm .seal-trace { stroke-dashoffset: 0; }
.pw.calm .pw-unlock.lit > i { box-shadow: none; }
html[data-motion="less"] .newdot, html[data-motion="less"] .pw-fin, html[data-motion="less"] .pw-medal i { animation: none; }
@media (prefers-reduced-motion: reduce) { .newdot, .pw-fin, .pw-medal i, .patron-mark *, .pw-just-opened .sh-ui { animation: none; } .pw-fin { transition: none; } }

/* Free while it grows: the founding member's charter. One seal, the name, the number and the date. */
.pw.founder .charter-seal { width: 148px; height: 148px; margin: 22px 0 18px; }
.pw.founder .pw-w h1 { font-size: 34px; line-height: 38px; margin-bottom: 10px; }
.pw.founder .pw-w p { font-size: 15px; line-height: 23px; max-width: 22em; }
.pw.founder .charter-name { margin-top: 18px; }
.pw.founder .charter-sign { margin-top: 22px; }
.pw.founder .charter-sign > span:first-child { font-size: 12px; line-height: 17px; }
@media (max-height: 720px) { .pw.founder .charter-seal { width: 96px; height: 96px; margin: 10px 0; } .pw.founder .pw-w h1 { font-size: 30px; line-height: 34px; } }

/* Night (owner 20 Nov 2026): the founding charter on a lapis night, vellum words, the gold seal glowing softly */
html[data-theme="candlelight"] .pw, html[data-theme="dark"] .pw { color: var(--ink); background: radial-gradient(ellipse at 50% 30%, #1e3566 0%, #14254c 48%, #0d1730 100%); }
html[data-theme="candlelight"] .pw-charter, html[data-theme="dark"] .pw-charter { border-color: rgba(217, 184, 103, .62); background: rgba(241, 232, 210, .025);
  box-shadow: inset 0 0 0 4px transparent, inset 0 0 0 5px rgba(217, 184, 103, .22), 0 16px 36px -22px rgba(0, 0, 0, .9); }
html[data-theme="candlelight"] .charter-seal, html[data-theme="dark"] .charter-seal { border-radius: 50%; box-shadow: 0 0 44px 2px rgba(217, 184, 103, .24); }
html[data-theme="candlelight"] .charter-house, html[data-theme="dark"] .charter-house,
html[data-theme="candlelight"] .charter-house span, html[data-theme="dark"] .charter-house span,
html[data-theme="candlelight"] .charter-name, html[data-theme="dark"] .charter-name,
html[data-theme="candlelight"] .charter-script, html[data-theme="dark"] .charter-script,
html[data-theme="candlelight"] .pw-eye, html[data-theme="dark"] .pw-eye { color: var(--gold-ink); }
html[data-theme="candlelight"] .pw-w h1, html[data-theme="dark"] .pw-w h1, html[data-theme="candlelight"] .pw-unlock b, html[data-theme="dark"] .pw-unlock b { color: var(--ink); }
html[data-theme="candlelight"] .pw-w p, html[data-theme="dark"] .pw-w p, html[data-theme="candlelight"] .pw-unlock small, html[data-theme="dark"] .pw-unlock small,
html[data-theme="candlelight"] .charter-sign > span:first-child, html[data-theme="dark"] .charter-sign > span:first-child,
html[data-theme="candlelight"] .charter-sign small, html[data-theme="dark"] .charter-sign small,
html[data-theme="candlelight"] .pw-skip, html[data-theme="dark"] .pw-skip, html[data-theme="candlelight"] .pw-snd, html[data-theme="dark"] .pw-snd,
html[data-theme="candlelight"] .pw-explore, html[data-theme="dark"] .pw-explore { color: var(--ink-2); }
html[data-theme="candlelight"] .charter-sign, html[data-theme="dark"] .charter-sign, html[data-theme="candlelight"] .pw-unlock, html[data-theme="dark"] .pw-unlock { border-top-color: rgba(217, 184, 103, .32); }
html[data-theme="candlelight"] .pw .pw-go, html[data-theme="dark"] .pw .pw-go { color: #1c1508; border-color: #b8913c; box-shadow: 0 10px 24px -14px rgba(217, 184, 103, .45); }
html[data-theme="candlelight"] .pw-tour, html[data-theme="dark"] .pw-tour { background: var(--sky, #0f1a33); }
html[data-theme="candlelight"] .patron-mark, html[data-theme="dark"] .patron-mark { border-color: rgba(217, 184, 103, .35); background: rgba(241, 232, 210, .03); }

/* Owner 20 Nov (#890): one rubric mark everywhere a thing is new or unread. Not a glowing gold dot: a small crisp
   vermilion lozenge, as a scribe set in the margin, in both themes. */
:root { --rubric: #b3341b; }
html[data-theme="candlelight"], html[data-theme="dark"] { --rubric: #ee6a4b; }
.newdot, .seal, nav#nav button.hasnew::after {
  width: 10px; height: 10px; border-radius: 0; box-shadow: none; animation: none;
  background: linear-gradient(135deg, rgba(255, 236, 214, .32), rgba(255, 236, 214, 0) 46%), var(--rubric);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.nlc > .seal { width: 11px; height: 11px; box-shadow: none; }
nav#nav button.hasnew::after { top: 6px; left: calc(50% + 10px); }

/* the charter's headpiece: the same Bening border as the Discover Pro window, so buying (or keeping Pro as a founder)
   ends in the book it began in (owner #756: "not enough of a privilege") */
.charter-art { align-self: stretch; height: 84px; margin: 0 0 18px; overflow: hidden; border: 1px solid rgba(176, 136, 62, .55); border-radius: 3px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 6px 14px -10px rgba(80, 55, 20, .55); }
.charter-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 46%; }
@media (max-height: 700px) { .charter-art { height: 56px; margin-bottom: 10px; } }
