/* Chaffiti website: public pages + /admin. Palette matches the Safari extension. */

:root {
  --surface: #fff;
  --soft: #f6f6f7;
  --text: #1a1a1c;
  --muted: #66666c;
  --line: rgba(0, 0, 0, .08);
  --line-strong: rgba(0, 0, 0, .14);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, .08);
  --primary-bg: #111113;
  --primary-text: #fff;
  --warning: #b45309;
  --warning-soft: rgba(217, 119, 6, .1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .08);
  --success: #15803d;
  /* Verified seals, by kind (contract "Verified accounts") */
  --seal-person: #2563eb;
  --seal-official: #0f5132;
  --seal-company: #d97706;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1c1c1f;
    --soft: #242428;
    --text: #f2f2f3;
    --muted: #a3a3aa;
    --line: rgba(255, 255, 255, .09);
    --line-strong: rgba(255, 255, 255, .16);
    --accent: #6ea2ff;
    --accent-soft: rgba(110, 162, 255, .12);
    --primary-bg: #f2f2f3;
    --primary-text: #111113;
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, .12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .12);
    --success: #4ade80;
    --seal-official: #1e9e5a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 40rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header / footer */
.site-header { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
               background: color-mix(in srgb, var(--surface) 88%, transparent);
               -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 3.75rem; }
.wordmark { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.wordmark:hover { text-decoration: none; }

.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; padding: 2rem 0 calc(2rem + env(safe-area-inset-bottom)); color: var(--muted); font-size: .9rem; }
.site-footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.site-footer a { color: var(--muted); }
.site-footer p { margin: 0; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
          min-height: 2.75rem; padding: .6rem 1.25rem; border-radius: 999px; border: 1px solid transparent;
          font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; cursor: pointer;
          text-decoration: none; white-space: nowrap; transition: opacity .15s, background-color .15s; }
.button:hover { text-decoration: none; opacity: .88; }
.button-primary { background: var(--primary-bg); color: var(--primary-text); }
.button-secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.button-secondary:hover { background: var(--soft); opacity: 1; }
.button-danger { background: var(--danger); color: #fff; }
.button-small { min-height: 2.25rem; padding: .4rem 1rem; font-size: .875rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; }
/* Download button before launch (SiteHelper#app_store_button): looks like a button, isn't a link. */
.button-soon, .button-soon:hover { cursor: default; opacity: .8; }
/* The two halves are flex items, so the gap is the space between the words. */
.button-soon { gap: .28em; }
@media (max-width: 30rem) {
  .button-small .soon-detail { display: none; }
}

/* Landing */
.hero { padding: 4.5rem 0 3rem; text-align: center; }
.hero .lede { font-size: clamp(1.1rem, 2.6vw, 1.3rem); color: var(--muted); max-width: 36rem; margin: 0 auto 2rem; }
.hero .button-row { justify-content: center; }
.eyebrow { display: inline-block; margin-bottom: 1rem; padding: .3rem .8rem; border-radius: 999px;
           background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: .85rem; }

.demo { max-width: 34rem; margin: 3rem auto 0; text-align: left; border: 1px solid var(--line);
        border-radius: 20px; background: var(--soft); box-shadow: var(--shadow); overflow: hidden; }
.demo-bar { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.demo-dots { display: flex; gap: .35rem; }
.demo-dots i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line-strong); }
.demo-url { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); background: var(--surface);
            border-radius: 8px; padding: .25rem .5rem; margin-right: 1.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-body { padding: 1rem; display: grid; gap: .75rem; }

.section { padding: 3.5rem 0; }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title p { color: var(--muted); max-width: 32rem; margin: 0 auto; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: 1fr; counter-reset: step; }
.steps li { counter-increment: step; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; background: var(--surface); }
.steps li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center;
                    width: 2rem; height: 2rem; border-radius: 50%; margin-bottom: .9rem;
                    background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.steps p, .features p { color: var(--muted); margin: 0; }

.features { display: grid; gap: 1.5rem 2rem; grid-template-columns: 1fr; }
.features h3 { margin-bottom: .35rem; }

.cta-band { text-align: center; border-radius: 24px; background: var(--soft); border: 1px solid var(--line); padding: 3rem 1.5rem; }
.cta-band p { color: var(--muted); }
.cta-band .button-row { justify-content: center; }

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(3, 1fr); }
}

/* Comments (share page + landing demo) */
.comment { display: grid; grid-template-columns: 2.5rem 1fr; gap: .75rem; }
.avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
          background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; margin-bottom: .2rem; }
.comment-author { font-weight: 650; }
.comment-author .seal-info { display: inline-block; margin-left: .3rem; position: relative; font-weight: 400; }
/* A bare seal right after the name (Activity rows), spaced like the one with info. */
.comment-author > .seal { margin-left: .3rem; }
.seal-info summary { list-style: none; cursor: pointer; display: inline-flex; vertical-align: -0.12em; }
.seal-info summary::-webkit-details-marker { display: none; }
.seal-info .seal-note { position: absolute; left: 50%; top: calc(100% + .35rem); transform: translateX(-50%); z-index: 5; width: max-content;
  max-width: 16rem; padding: .45rem .7rem; border-radius: 10px; background: var(--primary-bg); color: var(--primary-text); font-size: .8rem; line-height: 1.35; box-shadow: var(--shadow); }
.comment-meta { color: var(--muted); font-size: .85rem; }
.comment-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.comment-stats { display: flex; gap: 1rem; margin-top: .5rem; color: var(--muted); font-size: .85rem; }
.comment-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }

/* Signed out: Reply on a page view's top comments opens a reply box under the comment; a thread page has one under its
   comment. You write first, then its Reply opens Sign up to reply (layouts/_sign_in_dialog, kind: :reply; ReplyFromLink). */
.comment-stats:has(.reply-pill) { align-items: center; }
.reply-pill { display: inline-flex; align-items: center; gap: .3rem; margin: -.3rem 0; padding: .3rem .7rem; border: 0; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.reply-pill:hover { opacity: .85; text-decoration: none; }
a.reply-pill { color: var(--accent); text-decoration: none; }
.reply-draft { display: grid; gap: .5rem; margin: 1rem 0 0; padding-top: .85rem; border-top: 1px solid var(--line); }
.reply-draft[hidden] { display: none; }
.reply-draft label { display: block; }
.reply-draft textarea { display: block; width: 100%; padding: .6rem .75rem; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; line-height: 1.4; resize: vertical; }
.reply-draft textarea::placeholder { color: var(--muted); }
.reply-draft textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.reply-draft-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.reply-draft-foot span { color: var(--muted); font-size: .825rem; }
.reply-draft-foot .button { min-height: 2.4rem; padding: .4rem 1.15rem; font-size: .9rem; }

.share { padding: 2rem 0 0; }
.share-label { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .5rem .25rem; }
.page-card { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.page-card-image { display: block; width: 100%; height: auto; aspect-ratio: 1.91 / 1; object-fit: cover; background: var(--soft); }
.page-card-body { padding: 1rem 1.25rem 1.1rem; }
.page-card-site { display: flex; align-items: baseline; gap: .4rem; color: var(--muted); font-size: .85rem; font-weight: 600; margin-bottom: .35rem; min-width: 0; }
.page-card-icon { flex: none; align-self: center; width: 1.25rem; height: 1.25rem; border-radius: 5px; object-fit: contain; }
.page-card-site .path { font-weight: 500; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The site's name stays on one line beside its favicon; the address is what's cut with … */
.page-card-site > span:not(.path) { flex: none; white-space: nowrap; }
.page-card-title { font-size: 1.3rem; line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .4rem; overflow-wrap: anywhere; }
.page-card-desc { color: var(--muted); margin: 0; font-size: .95rem; overflow-wrap: anywhere;
                  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.page-card-open { display: flex; justify-content: space-between; align-items: center; padding: .65rem 1.25rem; border-top: 1px solid var(--line);
                  background: var(--soft); font-size: .9rem; font-weight: 600; }
.page-card-open:hover { text-decoration: none; background: var(--accent-soft); }
/* The extension marks <html data-chaffiti-extension> on Chaffiti's pages: the link
   then opens its panel on the page, and its label says so. */
.page-card-open .with-extension, html[data-chaffiti-extension] .page-card-open .without-extension { display: none; }
html[data-chaffiti-extension] .page-card-open .with-extension { display: inline; }

/* ---------- The page card folds into its title as you scroll (page_card.js) ----------
   On a page view and a comment page, the card stays under the header and folds: the picture goes first, then what's
   marked data-fold-away (the site line, description, notice, Follow and Send this page, the Open row), while the
   favicon and the fold tools (Follow and Send this page as icons, and the open arrow) come in beside the title.
   The browser keeps the card in place (position: sticky), and where it can tie an animation to the scroll position
   (Chrome, Safari 26) it runs the fold too, so nothing moves out of step with the page; elsewhere the script sets
   --fold as you scroll. The margin under the card grows as the card shrinks, so what's below never moves.
   The script reads the card's sizes into the variables used here once, and again when the window changes size. */
.page-card-title-row { display: flex; align-items: center; min-width: 0; }
.page-card-title-row .page-card-title { flex: 1 1 auto; min-width: 0; }
.page-card-fold-icon, .page-card-fold-tools { display: none; }
html[data-chaffiti-extension] .page-card-fold-open .without-extension { display: none; }
.page-card-fold-open .with-extension { display: none; }
html[data-chaffiti-extension] .page-card-fold-open .with-extension { display: inline; }

@property --fold { syntax: "<number>"; inherits: true; initial-value: 0; }
@keyframes page-card-fold { from { --fold: 0; } to { --fold: 1; } }
/* The card loses the same height for each bit of scroll, and what's in it loses exactly that much, so it always fills
   the card: first the picture takes all of it (--fold-a, until it's gone; --fold-split is the picture's share of the
   whole fold), then the rest folds (--fold-b). */
.page-card.is-folding { position: sticky; top: var(--fold-top); z-index: 5;
  --fold-a: clamp(0, var(--fold) / var(--fold-split), 1); --fold-b: clamp(0, (var(--fold) - var(--fold-split)) / (1 - var(--fold-split)), 1);
  height: calc(var(--fold-h) - (var(--fold-h) - var(--fold-mini)) * var(--fold));
  margin-bottom: calc(var(--fold-mb) + (var(--fold-h) - var(--fold-mini)) * var(--fold));
  border-radius: calc(20px - 6px * var(--fold-b)); }
.page-card.is-folding.is-scroll-linked { animation: page-card-fold linear both; animation-timeline: scroll(root block);
  animation-range: var(--fold-from) var(--fold-to); }
/* Part-way folded, the card clips what's shrinking (more specific than the signed-in card's own overflow: visible, which
   lets Follow's menu open past its edge, unfolded or folded). */
.page-card.is-folding.is-partly-folded { overflow: hidden; }
.page-card.is-mini [data-fold-away] { overflow: hidden; }
.page-card.is-folding .page-card-image { height: calc(var(--fold-img) * (1 - var(--fold-a))); aspect-ratio: auto; }
.page-card.is-folding [data-fold-away] { height: calc(var(--part-h) * (1 - var(--fold-b))); opacity: calc(1 - var(--fold-b));
  margin-top: calc(var(--part-mt) * (1 - var(--fold-b))); margin-bottom: calc(var(--part-mb) * (1 - var(--fold-b)));
  padding-top: calc(var(--part-pt) * (1 - var(--fold-b))); padding-bottom: calc(var(--part-pb) * (1 - var(--fold-b))); }
.page-card.is-folding .page-card-body { padding:
  calc(var(--fold-pt) + (8px - var(--fold-pt)) * var(--fold-b)) calc(var(--fold-pr) + (10px - var(--fold-pr)) * var(--fold-b))
  calc(var(--fold-pb) + (8px - var(--fold-pb)) * var(--fold-b)) calc(var(--fold-pl) + (14px - var(--fold-pl)) * var(--fold-b)); }
/* The title's box goes from its own height to one line; until then a long title keeps wrapping, and what doesn't fit is
   cut off, as the rest of the card is. */
.page-card.is-folding .page-card-title { font-size: calc(var(--fold-tf) + (16px - var(--fold-tf)) * var(--fold-b));
  margin-bottom: calc(var(--fold-tg) * (1 - var(--fold-b))); overflow: hidden;
  height: calc(var(--fold-th) + (var(--fold-tmini) - var(--fold-th)) * var(--fold-b)); }
.page-card.is-folding .page-card-fold-icon { display: block; flex: none; height: 1.25rem; border-radius: 5px; object-fit: contain;
  width: calc(20px * var(--fold-b)); margin-right: calc(10px * var(--fold-b)); opacity: var(--fold-b); }
.page-card.is-folding .page-card-fold-tools { display: flex; align-items: center; gap: 6px; flex: none; overflow: hidden;
  width: calc(var(--fold-tools) * var(--fold-b)); margin-left: calc(8px * var(--fold-b)); opacity: var(--fold-b); }
.page-card.is-folded .page-card-title { white-space: nowrap; text-overflow: ellipsis; }
.page-card.is-folded .page-card-open { border-top-width: 0; }
/* What's folded away can't be reached, and the fold tools can't be until the fold begins. */
.page-card.is-folded [data-fold-away], .page-card.is-folding:not(.is-mini) .page-card-fold-tools { visibility: hidden; }
/* Folded all the way: Follow's menu opens below the card. */
.page-card.is-folded, .page-card.is-folded .page-card-body, .page-card.is-folded .page-card-title-row,
.page-card.is-folded .page-card-fold-tools { overflow: visible; }
/* Under the header, a band of the page's colour above the card, and a shadow under it. */
.page-card.is-pinned { box-shadow: 0 -9px 0 0 var(--surface), 0 1px 2px rgba(0, 0, 0, .05), 0 10px 24px rgba(0, 0, 0, .09); }
.page-card.is-measuring { height: auto; margin-bottom: var(--fold-mb); animation: none; }

/* The fold tools: Follow, Send this page and the open arrow alike, 28px circles with the pill buttons' outline. */
.page-card-fold-tools > .page-actions-compact { display: flex; align-items: center; gap: 6px; }
.page-card-fold-tools .pill-button, .page-card-fold-tools .follow-menu > summary.pill-button, .page-card-fold-open {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; flex: none;
  width: 28px; height: 28px; min-width: 28px; min-height: 0; padding: 0; gap: 0; border: 1px solid var(--line-strong); border-radius: 999px;
  background: none; color: var(--text); font-size: 0; }
.page-card-fold-tools .pill-button:hover, .page-card-fold-open:hover { text-decoration: none; background: var(--soft); }
.page-card-fold-tools .icon { width: 15px; height: 15px; }
/* Follow's menu hangs from the card's right edge, so it stays on a phone's screen. */
.page-card-fold-tools .cmenu { position: static; margin: 0; }
.page-card-fold-tools .cmenu > .menu { right: .4rem; left: auto; top: calc(100% + 6px); font-size: .9rem; }

.thread-context { padding: 1rem; border-radius: var(--radius); border: 1px dashed var(--line-strong); margin-bottom: .5rem; }
.thread-context .label, .replies-label { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .6rem; }
.thread-context .comment-text { color: var(--muted); }
.thread-context > p { margin: 0; }
.thread-line { width: 2px; height: 1rem; background: var(--line-strong); margin: 0 0 .5rem 1.2rem; }

.featured { padding: 1.25rem; border-radius: 20px; box-shadow: var(--shadow); }
.featured .comment-text { font-size: 1.15rem; line-height: 1.5; }

.replies { margin: 1.5rem 0 0 1.2rem; padding-left: 1.25rem; border-left: 2px solid var(--line); display: grid; gap: 1.1rem; }
.replies-more { color: var(--muted); font-weight: 600; font-size: .9rem; margin: 0; }

/* The one download prompt, after the thread */
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
       margin-top: 2rem; padding: 1.25rem; border-radius: 20px; background: var(--accent-soft); }
.cta > div { flex: 1 1 16rem; }
.cta h2 { font-size: 1.2rem; margin: 0 0 .25rem; }
.cta p { margin: 0; color: var(--muted); }

.notice { text-align: center; padding: 5rem 0 2rem; }
.notice p { color: var(--muted); }
.notice .button-row { justify-content: center; }
/* /hello: the walkthrough's first-comment page */
.hello .hello-setup { text-align: center; margin-top: 2.5rem; flex-direction: column; justify-content: center; }
.hello .hello-setup > div { flex: none; }
.hello .hello-setup p { color: var(--text); }
.hello .hello-web { justify-content: center; margin-top: 1.5rem; }

/* Sign-in result pages (the tab the extension opens for Sign in with Apple) */
body.auth-result { background: var(--soft); }
.auth-result main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem calc(2rem + env(safe-area-inset-bottom)); }
.auth-card { width: 100%; max-width: 24rem; text-align: center; padding: 2rem 1.5rem; border-radius: 20px;
             background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-card .wordmark { margin-bottom: 1.75rem; }
.auth-card h1 { font-size: 1.4rem; }
.auth-card p { color: var(--muted); }
.auth-card p:last-child { margin: 0; }
.auth-card strong { color: var(--text); }
.status-icon { display: flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; margin: 0 auto 1rem;
               border-radius: 50%; background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.status-icon-warning { background: var(--warning-soft); color: var(--warning); }

/* Long-form pages */
.prose { padding: 3rem 0 0; }
.prose h1 { font-size: clamp(1.9rem, 5vw, 2.5rem); }
.prose h2 { font-size: 1.3rem; margin-top: 2.25rem; }
.prose h3 { margin-top: 1.5rem; }
/* Linked sections (privacy#web-pages) land below the sticky header. */
.prose [id] { scroll-margin-top: 4.75rem; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 1.25rem; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose .updated { color: var(--muted); font-size: .9rem; }

/* ---------- Shared with /admin (its shell and the rest: admin.css) ---------- */
.badge { display: inline-flex; align-items: center; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 650;
         background: var(--soft); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-verified { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.seal { vertical-align: -0.12em; flex: none; }

.flash { padding: .75rem 1rem; border-radius: 12px; margin-bottom: 1.25rem; background: var(--accent-soft); color: var(--text); }
.flash-alert { background: var(--danger-soft); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; }
.stat { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; color: var(--text); }
a.stat:hover { text-decoration: none; border-color: var(--line-strong); }
.stat-value { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .9rem; }
.stat-note { font-size: .8rem; margin-top: .25rem; }
.stat-warning .stat-value, .stat-note.warning { color: var(--warning); }

.tabs { display: flex; gap: .25rem; margin: 1rem 0 1.5rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: .6rem .9rem; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--text); }
.tabs-secondary { margin-top: -1rem; }
.tabs-secondary a { font-size: .875rem; padding: .45rem .8rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.panel-overdue { border-color: var(--warning); box-shadow: inset 4px 0 0 var(--warning); }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .75rem; }
.panel-head .meta { color: var(--muted); font-size: .875rem; }
.quote { white-space: pre-wrap; overflow-wrap: anywhere; padding: .75rem 1rem; border-radius: 10px; background: var(--soft); margin: 0 0 .75rem; }
.quote.removed { text-decoration: line-through; color: var(--muted); }
.thread-context { margin: -.25rem 0 .75rem; line-height: 1.5; }
.report-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; font-size: .9rem; }
.report-list li { padding-left: .75rem; border-left: 2px solid var(--line-strong); }
.report-list .desc { color: var(--muted); display: block; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
/* Admin › Review */
.review-batch { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; position: sticky; top: .5rem; z-index: 2; }
.review-batch label { font-weight: 600; font-size: .875rem; }
.review-select { display: inline-flex; margin-right: .35rem; vertical-align: middle; }
.review-select input { width: 1.1rem; height: 1.1rem; }
.review-flags { list-style: none; padding: 0; margin: 0 0 .75rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.actions form { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .925rem; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem 1.5rem; margin: 0 0 1.25rem; }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { margin: 0; font-weight: 600; }

.search { display: flex; gap: .5rem; margin-bottom: 1rem; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: -.5rem 0 1.25rem; }
.filters input[type=search], .filters select { font: inherit; font-size: .875rem; padding: .45rem .8rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); min-width: 0; }
.filters input[type=search] { flex: 1 1 12rem; }
/* Admin forms with labelled fields (Send a message, Post as @chaffiti) */
.stack-form { display: grid; gap: .35rem; max-width: 36rem; margin: .5rem 0; }
.stack-form label { color: var(--muted); font-size: .8rem; margin-top: .4rem; }
.stack-form input[type=text], .stack-form input[type=url], .stack-form textarea, .stack-form select { font: inherit; padding: .55rem .8rem; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); min-width: 0; }
.stack-form .check { display: flex; align-items: center; gap: .5rem; color: var(--text); font-size: .9rem; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0 .25rem; }
.inline-form input[type=text] { font: inherit; font-size: .9rem; padding: .4rem .75rem; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); min-width: 0; flex: 0 1 16rem; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1rem 0 2rem; }
.search input { flex: 1; min-width: 0; font: inherit; padding: .55rem .9rem; border-radius: 999px; border: 1px solid var(--line-strong);
                background: var(--surface); color: var(--text); }

.wall-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
@media (max-width: 760px) { .wall-editor { grid-template-columns: minmax(0, 1fr); } }
.wall-form { display: grid; gap: .9rem; margin: 0; }
.wall-form label, .wall-form fieldset { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; }
.wall-form fieldset { border: 0; padding: 0; margin: 0; }
.wall-form legend { padding: 0; margin-bottom: .3rem; }
.wall-form label.choice { display: flex; align-items: center; gap: .4rem; font-weight: 500; }
.wall-form input[type=text] { font: inherit; font-weight: 400; padding: .5rem .8rem; border-radius: 10px; border: 1px solid var(--line-strong);
                              background: var(--surface); color: var(--text); min-width: 0; width: 100%; }
.wall-form .pair { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.wall-form .muted { font-weight: 400; }
.wall-places { margin: 0; }
.wall-places h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.wall-place { padding: .6rem 0; border-top: 1px solid var(--line); }
.wall-place p { margin: .2rem 0 0; }
.wall-place-inactive { opacity: .45; }

.signin { max-width: 24rem; margin: 6rem auto; text-align: center; }
.signin .panel { padding: 2rem; }
.signin form { margin-top: 1.25rem; }

/* Website sign-in and account (sessions/new, accounts/show) */
.web-signin { max-width: 26rem; margin: 4rem auto; text-align: center; }
.web-signin .panel { padding: 2rem 1.5rem; }
.web-signin h1 { font-size: 1.6rem; overflow-wrap: anywhere; }
.web-signin .sign-in-form { margin: 1.25rem 0; }
.web-signin .flash { text-align: left; }
.sign-in-buttons { display: grid; gap: .75rem; margin: 1.5rem 0; }
.signin .sign-in-buttons { margin-bottom: 0; }
.sign-in-buttons .sign-in-form { margin: 0; }
.button-provider { width: 100%; gap: .6rem; }
/* Google's button colors (light and dark), next to Apple's black and white. */
.button-google { background: #fff; color: #1f1f1f; border-color: #747775; }
.button-google:hover { background: #f8f8f8; opacity: 1; }
@media (prefers-color-scheme: dark) {
  .button-google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
  .button-google:hover { background: #1f1f20; }
}
.header-account { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 1.35rem; }
/* Phones: the logo, search, download button and your name share one row. */
@media (max-width: 30rem) {
  .header-account { max-width: 6.5rem; padding-inline: .75rem; }
}

/* ---------- Page view (/p/…) ---------- */
.page-view .page-card-title { font-size: 1.45rem; }
.page-card-notice { margin: 0 0 .5rem; padding: .55rem .8rem; border-radius: 10px; background: var(--warning-soft); color: var(--text); font-size: .9rem; }
.top-label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem;
             padding-bottom: .6rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.top-label h2 { font-size: 1.15rem; margin: 0; }
.top-comments { display: grid; gap: 1.4rem; }
.comment-time, .comment-replies { color: inherit; text-decoration: none; }
.comment-time:hover, .comment-replies:hover { text-decoration: underline; }
.comment-replies { font-weight: 600; }
.store-note { color: var(--muted); font-weight: 600; margin: 0; }
/* .another-box: signed in, the field for another page in a box like the gate, after the wall (pages/_another_page). */
.gate, .another-box { margin-top: 1.75rem; padding: 1.5rem 1.25rem; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--soft); text-align: center; }
.gate h2 { font-size: 1.25rem; margin: 0 0 .35rem; }
.gate p { color: var(--muted); max-width: 30rem; margin: 0 auto 1.1rem; }
.gate .button-row { justify-content: center; }

/* ---------- Profile, light (/u/…) ---------- */
.author-link { color: inherit; }
.profile-card { display: flex; align-items: center; gap: 1rem; padding: 1.25rem;
                border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.avatar-large { width: 4rem; height: 4rem; font-size: 1.6rem; flex: none; }
.profile-card-body { min-width: 0; }
.profile-name { font-size: 1.45rem; line-height: 1.2; letter-spacing: -.015em; margin: 0; overflow-wrap: anywhere; }
.profile-name .seal-info { display: inline-block; margin-left: .35rem; position: relative; font-size: 1rem; font-weight: 400; letter-spacing: 0; }
.profile-real-name { margin: .15rem 0 0; font-weight: 600; }
.profile-verified { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
.profile-meta { margin: .3rem 0 0; color: var(--muted); font-size: .875rem; }

.restricted .status-icon { margin-bottom: .9rem; }
.domain-pill { display: inline-block; margin: 0 0 1rem; padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--line);
               background: var(--soft); font: 500 .85rem/1.3 ui-monospace, "SF Mono", Menlo, monospace; color: var(--text); }
.restricted h1 { font-size: clamp(1.6rem, 4.5vw, 2.1rem); }
.site-kinds { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.site-kinds li { padding: .2rem .65rem; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: .8rem; }
.site-kinds li.match { background: var(--warning-soft); color: var(--warning); font-weight: 650; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; }
.lookup-inline { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; max-width: 30rem; margin: 0 auto; }
.lookup-inline input { flex: 1 1 14rem; min-width: 0; font: 16px/1.3 ui-monospace, "SF Mono", Menlo, monospace; padding: .6rem .9rem;
                       border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }

/* ---------- Page view: picked pages under an empty page (HomePicks) ---------- */
.picks { margin-top: 2rem; display: grid; gap: .75rem; }
.picks-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.picks-head h2 { font-size: 1.1rem; margin: 0; }
.picks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.picks a { display: flex; gap: .85rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 16px; border: 1px solid var(--line); color: var(--text); }
.picks a:hover { text-decoration: none; background: var(--soft); }
.pick-mark { flex: none; width: 2.75rem; height: 2.75rem; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.pick-body { min-width: 0; display: grid; gap: .1rem; }
.pick-meta { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-title { font-weight: 700; }
.pick-quote { font-size: .9rem; color: var(--muted); }

/* ---------- Page view: the line under the card (signed out, Sign up; signed in, following the whole site: /plans) ---------- */
.site-line { display: flex; align-items: center; gap: .75rem; margin: -.5rem 0 1.5rem; padding: .8rem 1rem; border-radius: 16px;
             border: 1px solid var(--line); background: var(--soft); color: var(--text); font-size: .95rem; }
button.site-line { width: 100%; font: inherit; font-size: .95rem; line-height: inherit; text-align: left; cursor: pointer; }
.site-line:hover { text-decoration: none; border-color: var(--line-strong); }
.site-line-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.site-line-go { flex: none; color: var(--accent); font-weight: 600; white-space: nowrap; }

/* ---------- Page views and share pages: a field for another page (pages/_another_page) ---------- */
.another-page { display: grid; gap: .55rem; margin: 0; text-align: left; }
.another-page label { font-weight: 650; }
.another-page p { margin: 0; color: var(--muted); font-size: .8rem; }
.another-page-field { display: flex; align-items: center; gap: .4rem; padding: .25rem .25rem .25rem .8rem; border: 1px solid var(--line-strong);
                      border-radius: 12px; background: var(--surface); }
.another-page-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.another-page-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text);
                            font: 16px/1.3 ui-monospace, "SF Mono", Menlo, monospace; padding: .45rem 0; }
.another-page-field input::placeholder { color: var(--muted); font-family: var(--font); }
.another-page-field button { flex: none; border: 0; border-radius: 9px; padding: .55rem .9rem; background: var(--primary-bg); color: var(--primary-text);
                             font: inherit; font-weight: 600; font-size: .875rem; line-height: 1; cursor: pointer; }
.another-page-field button:hover { opacity: .88; }
/* Signed out, in the gate under Sign up and Sign in, after an "or". */
.gate-or { display: flex; align-items: center; gap: .75rem; margin: 1.25rem 0 1rem; color: var(--muted); font-size: .8rem; font-weight: 600;
           text-transform: uppercase; letter-spacing: .05em; }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
/* On a share page, after the call to action. */
.cta + .another-page { margin-top: 2rem; }

/* A plan's drawing beside its name (PlansHelper#plan_picture): full color, with the paper a touch dimmer in dark mode. */
.plan-pic { flex: none; }
@media (prefers-color-scheme: dark) { .plan-pic-paper { fill: #ecebe6; } }
