/* The flip book (public/flip.js): an announcement's PDF read like a book. Its own file since 12 Oct 2026, so the public reading page
   (/baca/) loads it without the whole app.css. Tokens only: a page that loads it defines them (app.css, or web/baca/baca.css). */
.ck-flip { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--wash); color: var(--ink); overflow: hidden; }
.ck-flip[open] { display: flex; flex-direction: column; }
.ck-flip::backdrop { background: var(--wash); }
.fl-top { display: flex; align-items: center; gap: 14px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--paper); border-bottom: 1px solid var(--line); }
.fl-name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl-n { font-size: 13px; color: var(--mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fl-stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.fl-msg { color: var(--mute); font-size: 14px; text-align: center; padding: 0 24px; max-width: 34em; }
.fl-book { position: relative; display: flex; perspective: calc(var(--pw) * 5); }
.fl-book.spread { width: calc(var(--pw) * 2); height: var(--ph); }
.fl-book.single { width: var(--pw); height: var(--ph); perspective: calc(var(--ph) * 4); perspective-origin: 50% 0; }
.fl-page { position: relative; width: var(--pw); height: var(--ph); flex: none; background: var(--paper); box-shadow: 0 14px 34px -22px rgba(0, 0, 0, .45); overflow: hidden; }
.fl-page canvas { display: block; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .2s; }
.fl-page.ready canvas { opacity: 1; }
.fl-page.instant canvas { transition: none; }
.fl-page small { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: var(--mute); }
.fl-page.blank { background: transparent; box-shadow: none; }
.fl-page.left::after, .fl-page.right::after { content: ''; position: absolute; top: 0; bottom: 0; width: 36px; pointer-events: none; }
.fl-page.left::after { right: 0; background: linear-gradient(to left, rgba(0, 0, 0, .14), transparent); }
.fl-page.right::after { left: 0; background: linear-gradient(to right, rgba(0, 0, 0, .12), transparent); }
.fl-leaf { position: absolute; top: 0; width: var(--pw); height: var(--ph); transform-style: preserve-3d; transition: transform .7s cubic-bezier(.35, .1, .2, 1); z-index: 3; }
.fl-leaf .face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.fl-leaf .backface { transform: rotateY(180deg); }
.fl-leaf.fwd { left: var(--pw); transform-origin: left center; }
.fl-leaf.fwd.go { transform: rotateY(-180deg); }
.fl-leaf.back { left: 0; transform-origin: right center; }
.fl-leaf.back.go { transform: rotateY(180deg); }
/* a pad on phones: the page flips up over its top edge */
.fl-leaf.pad { left: 0; transform-origin: 50% 0; transition-duration: .6s; }
.fl-leaf.pad.fwd.go { transform: rotateX(-180deg); }
.fl-leaf.pad.back { transform: rotateX(-180deg); }
.fl-leaf.pad.back.go { transform: rotateX(0deg); }
.fl-leaf .pad-back { transform: rotateX(180deg); background: linear-gradient(to bottom, var(--wash), var(--paper)); box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, .35); }
.fl-foot { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--paper); border-top: 1px solid var(--line); }
.fl-foot button { height: 36px; padding: 0 14px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; }
.fl-foot button:disabled { opacity: .35; cursor: default; }
.fl-range { width: min(360px, 40vw); accent-color: var(--gold); }

@media (prefers-reduced-motion: reduce) { .fl-leaf { transition: none; } }

.fl-tools { display: flex; align-items: center; gap: 4px; }
.fl-ib { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid transparent; background: none; color: var(--ink); cursor: pointer; padding: 0; text-decoration: none; }
.fl-ib:hover:not(:disabled) { border-color: var(--line); background: var(--wash); }
.fl-ib:disabled { opacity: .35; cursor: default; }
.fl-ib.on { color: var(--gold-text); }
.fl-ib[data-fl=mark].on svg { fill: currentColor; }
.fl-ib[hidden] { display: none; }
.fl-x { border: 1.5px solid var(--ink); margin-left: 4px; }
.fl-zoom { display: inline-flex; align-items: center; border: 1px solid var(--line); margin: 0 4px; }
.fl-zoom .fl-ib { width: 32px; height: 32px; }
.fl-zv { min-width: 52px; height: 32px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: pointer; }
.fl-stage.zoomed { display: block; overflow: auto; touch-action: pan-x pan-y; cursor: grab; }
.fl-stage.zoomed .fl-book { margin: 16px auto; }
.fl-stage[hidden], .fl-foot[hidden] { display: none; }
/* search bar under the tools, marks on the page, and the "only these pages" note */
.fl-find { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.fl-find[hidden] { display: none; }
.fl-fi { display: grid; color: var(--mute); }
.fl-q { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink); font: inherit; font-size: 16px; border-radius: 0; }
.fl-q:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.fl-fc { flex: none; font-size: 13px; color: var(--mute); white-space: nowrap; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
.fl-hl { position: absolute; background: var(--gold); opacity: .3; pointer-events: none; border-radius: 2px; }
.fl-hl.cur { opacity: .45; outline: 2.5px solid var(--gold); outline-offset: 1px; }
/* highlighter and capture in the PDF book (flip.js setMode) */
.fl-modebar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px; background: var(--paper); border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.fl-modebar > span:first-child { flex: 1 1 260px; }
.fl-hcs { display: inline-flex; gap: 6px; }
.fl-hc { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.fl-hc[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.fl-done { border: 1px solid var(--ink); background: var(--ink); color: var(--on-ink); padding: 5px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.c-yellow { background: var(--note-yellow); } .c-green { background: var(--note-green); } .c-blue { background: var(--note-blue); } .c-pink { background: var(--note-pink); }
.fl-mk, .fl-pv.hl i { position: absolute; mix-blend-mode: multiply; opacity: 1; border-radius: 2px; pointer-events: none; }
.fl-pv.hl i { background: inherit; }
.fl-pv { position: absolute; pointer-events: none; }
.fl-pv.hl { background: none !important; }
.fl-pv.hl.c-yellow i { background: var(--note-yellow); } .fl-pv.hl.c-green i { background: var(--note-green); } .fl-pv.hl.c-blue i { background: var(--note-blue); } .fl-pv.hl.c-pink i { background: var(--note-pink); }
.fl-pv.snap { border: 2px dashed var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.fl-stage.mode-hl .fl-page:not(.blank), .fl-stage.mode-snap .fl-page:not(.blank) { cursor: crosshair; touch-action: none; }
.fl-stage.mode-hl .fl-mk { pointer-events: auto; cursor: pointer; }
.fl-menu { position: fixed; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 12px 28px -16px rgba(0, 0, 0, .45); }
.fl-menu > button { border: 0; background: none; padding: 6px 8px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.fl-menu > button:hover { background: var(--wash); }
.fl-stage.fl-flash .fl-book { animation: fl-flash .35s ease-out; }
@keyframes fl-flash { 0% { filter: brightness(1.35); } 100% { filter: none; } }
@media (prefers-reduced-motion: reduce) { .fl-stage.fl-flash .fl-book { animation: none; } }
.fl-copyhl { margin-left: auto; }
.fl-tile.found .fl-thumb { outline: 2px solid var(--gold); outline-offset: -2px; }
.fl-only { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 6; display: flex; gap: 12px; align-items: center; padding: 6px 14px; background: var(--paper); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; box-shadow: 0 8px 20px -16px rgba(0, 0, 0, .4); }
.fl-only[hidden] { display: none; }
.fl-stage.zoomed .fl-only { position: sticky; top: 8px; left: auto; transform: none; width: max-content; margin: 8px auto 0; }
/* arrows on the page edges for mouse and trackpad (phones swipe and tap instead) */
.fl-side { display: none; position: absolute; top: 50%; z-index: 5; width: 48px; height: 72px; margin-top: -8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; place-items: center; padding: 0; opacity: .82; transition: opacity .15s, background .15s; }
.fl-side svg { width: 26px; height: 26px; }
.fl-side.prev { left: 14px; } .fl-side.next { right: 14px; }
.fl-side:hover, .fl-side:focus-visible { opacity: 1; background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.fl-side:disabled { opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .fl-side { display: grid; } }
@media (max-width: 560px) { .fl-find { padding: 6px 8px 6px 12px; gap: 2px; } .fl-fi { display: none; } .fl-fc { font-size: 12px; max-width: 34vw; margin: 0 4px; } .fl-find .fl-ib { width: 34px; } }
.fl-stage[hidden] ~ .fl-side { display: none; }
.fl-stage:focus { outline: none; }
.fl-book { transform-origin: center; }
.fl-page.marked::before { content: ''; position: absolute; top: 0; right: 18px; width: 14px; height: 24px; background: var(--gold); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); z-index: 2; }
.fl-resume { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 8px 14px; background: var(--paper); border: 1.5px solid var(--ink); font-size: 13px; white-space: nowrap; box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .4); z-index: 5; }
.fl-resume[hidden] { display: none; }
.fl-tip { position: absolute; right: 12px; top: 58px; max-width: min(340px, calc(100% - 24px)); display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--paper); color: var(--ink); border: 1.5px solid var(--ink); border-top: 3px solid var(--gold); font-size: 13px; line-height: 1.45; box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .4); z-index: 6; }
.fl-tip .btn { flex: none; }
.fl-grid { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 24px; }
.fl-grid[hidden] { display: none; }
.fl-gh { display: flex; gap: 6px; margin-bottom: 14px; }
.fl-gh button { font: inherit; font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); border-radius: 999px; cursor: pointer; }
.fl-gh button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.fl-gh button:disabled { opacity: .45; cursor: default; }
.fl-gh small { opacity: .7; margin-left: 4px; }
.fl-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.fl-tile { position: relative; display: grid; gap: 4px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; text-align: center; font: inherit; }
.fl-thumb { display: block; aspect-ratio: var(--ar); background: var(--paper) center / contain no-repeat; box-shadow: 0 6px 18px -12px rgba(0, 0, 0, .45); outline: 1px solid var(--line); }
.fl-tile:hover .fl-thumb { outline-color: var(--ink); }
.fl-tile.cur .fl-thumb { outline: 2.5px solid var(--gold); }
.fl-tile small { font-size: 12px; color: var(--mute); }
.fl-tile.marked::after { content: ''; position: absolute; top: 0; right: 10px; width: 12px; height: 20px; background: var(--gold); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
@media (max-width: 560px) {
  .fl-top { flex-wrap: wrap; gap: 6px 10px; padding-left: 12px; padding-right: 12px; }
  .fl-name { flex-basis: 50%; }
  .fl-tools { width: 100%; justify-content: space-between; }
  .fl-range { display: none; }
  .fl-foot button { flex: 1; }
  .fl-tiles { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}
