/* What every prap.app page shares: the header (logo, a short menu, Find box; nine dots instead of the menu on a narrow screen), the short list of apps,
   the Find panel, and the footer. Self-contained: it brings its own colours (--s-*) so it looks the same on a page
   with its own style sheet. Ink, paper and one red dot. No blue. */
:root {
  --s-paper: #ffffff; --s-wash: #f5f5f2; --s-ink: #111110; --s-soft: #3d3d3a; --s-muted: #6f6f69; --s-line: #e4e3de;
  --s-dot: #e5484d; --s-on-ink: #ffffff; --s-tile: #f1eee8; --s-veil: rgba(17, 17, 16, .28);
  --s-sans: "Segoe UI Variable Text", -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --s-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --s-top: 56px;
}
@media (prefers-color-scheme: dark) {
  :root { --s-paper: #0f0f0e; --s-wash: #191918; --s-ink: #f3f3ef; --s-soft: #cfcfc8; --s-muted: #9c9c94; --s-line: #2b2b28;
    --s-dot: #ff6b6f; --s-on-ink: #0f0f0e; --s-veil: rgba(0, 0, 0, .55); }
}

/* ---- header */
header.site-top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--s-paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid var(--s-line);
  font-family: var(--s-sans); }
.site-top-in { max-width: 1160px; margin: 0 auto; height: var(--s-top); padding: 0 20px; display: flex; align-items: center; gap: 16px; }
a.site-brand { display: flex; align-items: center; gap: 9px; color: var(--s-ink); font-weight: 600; font-size: 19px; letter-spacing: -.02em; text-decoration: none; flex: none; }
a.site-brand:hover { text-decoration: none; }
a.site-brand img { width: 26px; height: 26px; display: block; }
a.site-brand .mark-dark { display: none; }
@media (prefers-color-scheme: dark) { a.site-brand .mark-light { display: none; } a.site-brand .mark-dark { display: block; } }
.site-nav { display: flex; align-items: center; gap: 2px; flex: none; margin-left: 6px; }
.site-nav a { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border-radius: 9px; color: var(--s-ink); font-size: 15.5px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-expanded="true"] { background: var(--s-wash); text-decoration: none; }
.site-chev { width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .7; display: block; }
.site-mid { flex: 1; min-width: 0; display: flex; justify-content: flex-end; }
a.site-find { width: 100%; max-width: 280px; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 14px 0 16px; border: 1px solid var(--s-line);
  background: var(--s-wash); border-radius: 999px; color: var(--s-muted); font-size: 15px; line-height: 1; text-decoration: none; cursor: text; }
a.site-find:hover { text-decoration: none; border-color: color-mix(in srgb, var(--s-muted) 55%, var(--s-line)); }
a.site-find span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.site-find kbd, .finder-box kbd { margin-left: auto; font: 12px var(--s-mono); color: var(--s-muted); border: 1px solid var(--s-line); border-radius: 6px; padding: 2px 6px; background: var(--s-paper); flex: none; }
.site-glass { width: 13px; height: 13px; border: 2px solid currentColor; border-radius: 50%; position: relative; flex: none; display: block; margin-right: 4px; }
.site-glass::after { content: ""; position: absolute; width: 6px; height: 2px; background: currentColor; right: -6px; bottom: -3px; transform: rotate(45deg); border-radius: 2px; }
a.site-dots { width: 36px; height: 36px; border-radius: 10px; display: grid; grid-template-columns: repeat(3, 4px); gap: 4px; place-content: center;
  border: 1px solid transparent; cursor: pointer; flex: none; }
a.site-dots:hover, a.site-dots[aria-expanded="true"] { background: var(--s-wash); border-color: var(--s-line); }
a.site-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--s-ink); display: block; }
.site-top a:focus-visible, .site-apps a:focus-visible, .site-tools a:focus-visible, .site-foot a:focus-visible, .finder-box input:focus-visible { outline: 2px solid var(--s-dot); outline-offset: 2px; border-radius: 10px; }
.finder-box input:focus-visible { outline: none; }

/* ---- the dimmed page behind an open list or Find panel */
.site-veil { position: fixed; inset: 0; z-index: 38; background: var(--s-veil); }
.site-veil[hidden], .site-apps[hidden], .site-tools[hidden], .site-finder[hidden] { display: none; }

/* ---- what Apps (or the dots) opens: the short list. site.js puts it under the word that opened it. */
.site-apps { position: fixed; z-index: 41; top: calc(var(--s-top) + 8px); right: max(14px, calc((100vw - 1160px) / 2 + 14px)); width: min(360px, calc(100vw - 28px));
  max-height: calc(100vh - var(--s-top) - 24px); overflow: auto; background: var(--s-paper); color: var(--s-ink); border: 1px solid var(--s-line); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .18); font-family: var(--s-sans); }
.app-rows { padding: 10px; display: grid; gap: 2px; }
a.app-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; min-width: 0; color: var(--s-ink); text-decoration: none; }
a.app-row:hover, a.app-row:focus-visible { background: var(--s-wash); text-decoration: none; }
.app-row .t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.app-row b { font-weight: 600; font-size: 15.5px; letter-spacing: -.01em; }
.app-row small { color: var(--s-muted); font-size: 13.5px; }
.app-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 20px 14px; border-top: 1px solid var(--s-line); font-size: 14.5px; }
.app-foot a { color: var(--s-soft); text-decoration: none; }
.app-foot a:hover { color: var(--s-ink); text-decoration: underline; }
.app-foot a.go { color: var(--s-ink); font-weight: 500; }
.app-foot a.go::after { content: " \2192"; }

/* ---- what PDF tools opens: the tools in their groups */
.site-tools { position: fixed; z-index: 41; top: calc(var(--s-top) + 8px); left: max(14px, calc((100vw - 1160px) / 2 + 150px)); width: min(680px, calc(100vw - 28px));
  max-height: calc(100vh - var(--s-top) - 24px); overflow: auto; background: var(--s-paper); color: var(--s-ink); border: 1px solid var(--s-line); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .18); font-family: var(--s-sans); }
.tool-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px 20px; padding: 18px 20px 16px; }
.tool-cols div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-cols b { font: 500 11.5px var(--s-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--s-muted); padding: 0 8px 6px; }
.tool-cols a { color: var(--s-ink); text-decoration: none; font-size: 15px; padding: 5px 8px; border-radius: 8px; }
.tool-cols a:hover, .tool-cols a:focus-visible { background: var(--s-wash); text-decoration: none; }

/* ---- app icons: every app sits on the same paper tile */
.app-icon { width: 44px; height: 44px; border-radius: 11px; flex: none; background: var(--s-tile); display: grid; place-items: center; overflow: hidden; }
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-icon.mark { border: 1px solid #dedbd2; }
.app-icon.mark img { width: 66%; height: 66%; object-fit: contain; }
.app-icon.sm { width: 34px; height: 34px; border-radius: 9px; }

/* ---- what the Find box opens */
.site-finder { position: fixed; z-index: 42; top: 8px; left: 50%; transform: translateX(-50%); width: min(600px, calc(100vw - 20px)); background: var(--s-paper); color: var(--s-ink);
  border: 1px solid var(--s-line); border-radius: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .22); overflow: hidden; font-family: var(--s-sans); }
.finder-box { display: flex; align-items: center; gap: 10px; padding: 0 16px 0 18px; height: 52px; border-bottom: 1px solid var(--s-line); color: var(--s-muted); }
.finder-box input { flex: 1; min-width: 0; border: 0; background: none; color: var(--s-ink); font: 16px var(--s-sans); padding: 0; height: 100%; -webkit-appearance: none; appearance: none; }
.finder-box input::-webkit-search-cancel-button { display: none; }
.finder-list { max-height: min(60vh, 470px); overflow: auto; padding: 8px; }
.finder-cap { font: 500 11.5px var(--s-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--s-muted); padding: 10px 10px 4px; }
a.finder-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; color: var(--s-ink); text-decoration: none; min-width: 0; }
a.finder-row:hover { text-decoration: none; }
a.finder-row[aria-selected="true"] { background: var(--s-wash); }
.finder-row .t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.finder-row b { font-weight: 600; font-size: 15px; }
.finder-row small { color: var(--s-muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finder-row .glyph { width: 34px; height: 34px; border-radius: 9px; flex: none; border: 1px solid var(--s-line); display: grid; place-items: center; font: 500 11px var(--s-mono); color: var(--s-muted); }
.finder-none { padding: 18px 12px; color: var(--s-muted); font-size: 15px; }
.finder-none a { color: var(--s-ink); text-decoration: underline; }

/* ---- footer */
footer.site-foot { border-top: 1px solid var(--s-line); background: var(--s-paper); color: var(--s-muted); padding: 44px 0 36px; font: 14px/1.5 var(--s-sans); margin-top: 0; }
.site-foot-in { max-width: 1160px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 3fr); gap: 32px 48px; }
.foot-brand p { margin: 10px 0 0; max-width: 24ch; color: var(--s-muted); font-size: 14px; }
.foot-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 24px; }
.foot-cols div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.foot-cols b { color: var(--s-ink); font-weight: 600; font-size: 13px; }
.foot-cols a { color: var(--s-muted); text-decoration: none; }
.foot-cols a:hover { color: var(--s-ink); text-decoration: underline; }
.foot-fine { grid-column: 1 / -1; margin: 6px 0 0; padding-top: 20px; border-top: 1px solid var(--s-line); font-size: 13px; color: var(--s-muted); }

/* Wide: the menu shows and the dots are not needed. Narrow: the menu folds into the dots, and Find takes the middle. */
@media (min-width: 861px) { a.site-dots { display: none; } }
@media (max-width: 860px) {
  .site-nav { display: none; }
  .site-mid { justify-content: center; }
  a.site-find { max-width: 440px; }
  .site-foot-in { grid-template-columns: minmax(0, 1fr); }
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .site-top-in { padding: 0 16px; gap: 10px; }
  a.site-find kbd { display: none; }
  .site-apps { left: 0; right: 0; top: var(--s-top); width: auto; border-radius: 0 0 20px 20px; border-width: 0 0 1px; max-height: calc(100vh - var(--s-top)); }
  .site-finder { top: 0; width: 100vw; border-radius: 0 0 20px 20px; border-width: 0 0 1px; }
  .site-foot-in { padding: 0 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .site-apps, .site-tools, .site-finder { animation: site-in .14s ease-out; }
  @keyframes site-in { from { opacity: 0; margin-top: -6px; } to { opacity: 1; margin-top: 0; } }
}
