/* ---------- Asking before anything goes to the AI (section 26k) ----------
   The beta card's face (its small tracked label, a line in the book serif, the words, the one in ink) as a modal card
   in the middle of the screen, over a faint veil; on a phone or a tablet, a sheet from the bottom, as the Add and More
   sheets are. */
#aiperm {
  position: fixed; inset: 0; width: 380px; max-width: calc(100vw - 32px); height: fit-content; max-height: calc(100% - 32px);
  margin: auto; padding: 16px 16px 14px 18px; z-index: 2001;      /* (z-index: only where there's no <dialog>) */
  box-sizing: border-box; overflow: auto; border: 0; border-radius: 10px; color: var(--ink);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule), var(--pop);
}
#aiperm:not([open]) { display: none; }                  /* as browsers do; iOS 15.3 and older have no <dialog> */
#aiperm::backdrop { background: rgba(22, 27, 29, .18); }
#aiperm:focus { outline: none; }
#aiperm p { margin: 0; }
#aiperm .ib-s { margin-top: 8px !important; }
.pm-more {
  display: inline-block; margin: 8px 0 0 -2px; padding: 0 2px; border-radius: 3px; font: 500 12px/24px var(--f-ui); color: var(--ink-2);
  text-decoration: underline 1px; text-decoration-color: var(--rule-2); text-underline-offset: 3px;
}
@media (hover: hover) { .pm-more:hover { color: var(--ink); text-decoration-color: currentColor; } }
.pm-more:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
#aiperm .ib-row { margin-top: 12px; }
html.pocket #aiperm {
  position: fixed; inset: auto 8px calc(env(safe-area-inset-bottom, 0px) + 8px); width: auto; max-width: none;
  max-height: calc(100% - env(safe-area-inset-top, 0px) - 60px); margin: 0; padding: 18px 18px 14px 20px; border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--pop), var(--edge);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
html.pocket #aiperm .ib-row .btn { height: 44px; padding: 0 18px; }
/* A phone on its side, or a tablet: no wider than the sheets, in the middle. */
@media (max-height: 500px), (min-width: 700px) {
  html.pocket #aiperm { left: 0; right: 0; width: min(620px, calc(100% - 16px)); margin-inline: auto; }
}
