/* The public page of a public artifact (a/public-page.html, artifact_public.js; research/132 §7.1). Page-scoped apub-*
   classes only; colours and type from /styles.css and tokens.css. The bar is ours and always visible: the page below
   it is someone else's, in a sandboxed frame on another site. */
html, body.apub-page { height: 100%; }
body.apub-page { margin: 0; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; }
.apub-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.apub-bar { flex: none; display: flex; align-items: center; gap: 12px 18px; padding: 10px 18px; border-bottom: 1px solid var(--rule); background: #fff; }
.apub-brand { flex: none; display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.apub-what { flex: 1; min-width: 0; padding-left: 18px; border-left: 1px solid var(--rule); }
.apub-title { margin: 0; font-family: var(--sans); font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: 0; max-width: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apub-by { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apub-by b { font-weight: 600; color: var(--ink); }
.apub-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.apub-actions[hidden] { display: none; }
.apub-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 6px 14px; border-radius: 7px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font-family: var(--sans); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; }
.apub-btn:hover { background: var(--ink); color: #fff; }
.apub-btn.apub-primary { background: var(--action); border-color: var(--action); color: #fff; }
.apub-btn.apub-primary:hover { background: #9c2c0f; border-color: #9c2c0f; }
.apub-btn.apub-quiet { border-color: var(--rule); color: var(--ink-soft); }
.apub-btn.apub-quiet:hover { background: var(--bg-soft, #f4efe8); color: var(--ink); }
.apub-btn[disabled] { opacity: .55; cursor: default; }
.apub-notes { flex: none; }
.apub-note { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 18px; border-bottom: 1px solid var(--rule); background: var(--tint, #fdf1ea); font-size: 13px; }
.apub-frame { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.apub-iframe { flex: 1; display: block; width: 100%; border: 0; background: #fff; }
.apub-wait, .apub-missing { margin: 0; padding: 56px 24px; text-align: center; color: var(--ink-soft); }
.apub-missing h2 { margin: 0 0 8px; font-family: var(--sans); font-size: 18px; font-weight: 600; color: var(--ink); max-width: none; }
.apub-missing p { margin: 0 auto 18px; max-width: 46ch; }
.apub-dialog { width: min(480px, calc(100vw - 32px)); padding: 20px 22px; border: 1px solid var(--rule); border-radius: 12px; color: var(--ink); background: #fff; font-family: var(--sans); font-size: 14px; }
.apub-dialog::backdrop { background: rgba(30, 24, 18, .45); }
.apub-dialog h2 { margin: 0 0 6px; font-family: var(--sans); font-size: 17px; font-weight: 600; max-width: none; }
.apub-dialog label { display: block; margin: 14px 0 4px; font-size: 12.5px; font-weight: 600; }
.apub-dialog select, .apub-dialog textarea, .apub-dialog input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--rule-strong, #cfc6b8); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; }
.apub-small { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.apub-err { margin-top: 10px; color: var(--accent-deep, #a3300f); }
.apub-err[hidden] { display: none; }
.apub-follow-fine { margin-top: 10px; }
.apub-follow-done { margin-top: 12px; padding: 9px 11px; border-radius: 7px; background: var(--tint, #fdf1ea); color: var(--ink); }
.apub-follow-done[hidden], .apub-btn[hidden] { display: none; }
.apub-link-url { margin: 12px 0 0; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 7px; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.apub-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
@media (max-width: 900px) {
  /* a phone: the bar wraps (what it is, then the three actions), and the frame is as tall as the page says it is, so
     there is one scrollbar: the window's */
  html, body.apub-page { height: auto; min-height: 100%; }
  .apub-bar { flex-wrap: wrap; padding: 10px 14px; }
  .apub-brand span { display: none; }
  .apub-what { padding-left: 12px; }
  .apub-actions { width: 100%; }
  .apub-actions .apub-primary { flex: 1; }
  .apub-btn { min-height: 40px; }
  .apub-frame { flex: none; }
  .apub-iframe { flex: none; }
}
