.fv-title { font-size: 22px; margin: 6px 0 12px; }
.fv-sub { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--hint); margin: 16px 0 8px; }
.fv-hint { color: var(--hint); }
.fv-note { color: var(--hint); font-size: 13px; margin: 0 0 8px; }
.fv-error { padding: 12px; border-radius: 10px; background: var(--card); }
/* Rows are not selectable, so a long press on a row does not select its
   label; the document surface below always is. The filter is an input and
   stays selectable: on iOS WebKit user-select: none can make it untypeable. */
.fv-rows { -webkit-user-select: none; user-select: none; }
.fv-rows { display: grid; gap: 2px; border-radius: 12px; overflow: hidden; background: var(--sep); }
.fv-row {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0;
  background: var(--card); color: var(--fg); font: inherit; text-align: left; cursor: pointer;
}
.fv-dense .fv-row { padding: 7px 12px; }
.fv-row:active { filter: brightness(.95); }
.fv-icon { flex: none; width: 22px; text-align: center; font-size: 17px; }
.fv-row-main { flex: 1; min-width: 0; display: grid; }
.fv-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.fv-row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--hint); }
.fv-row-meta { flex: none; font-size: 12px; color: var(--hint); white-space: nowrap; }
.fv-filter {
  width: 100%; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--sep); border-radius: 10px;
  background: var(--card); color: var(--fg); font: inherit; font-size: 15px;
  -webkit-user-select: text; user-select: text;
}
/* A shown document: the always-light reading page (html.paper, see shell.css),
   a text column of at most 90ch centred on it. The page itself spans the
   window less its padding and safe areas: wide content measures it (.fv-bleed). */
.fv-page {
  --ink: #1f2328;
  --accent-ink: #0f454a;
  --soft: #f4f6f7;
  --rule: #e3e7e9;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  container-type: inline-size;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px; line-height: 1.6; color: var(--ink);
}
.fv-page > * { max-width: 90ch; margin-left: auto; margin-right: auto; }
.fv-head { margin-top: 4px; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.fv-doc-title { font-size: 15px; font-weight: 600; line-height: 1.35; margin: 0 0 2px; word-break: break-word; color: var(--hint); }
.fv-meta { margin: 0; font-size: 12px; color: var(--hint); }

/* Text on the reading surface is always selectable, with the platform's
   long-press callout, whatever a WebView or Telegram's styles default to. */
.fv-doc, .fv-doc *, .fv-text pre {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}

.fv-doc { overflow-wrap: break-word; text-rendering: optimizeLegibility; }
.fv-doc > :first-child { margin-top: 0; }
.fv-doc p { margin: 0 0 1.05em; }
.fv-doc a.fv-link { text-decoration: underline; cursor: pointer; }
.fv-doc h1, .fv-doc h2, .fv-doc h3, .fv-doc h4, .fv-doc h5, .fv-doc h6 { line-height: 1.28; font-weight: 700; }
.fv-doc h1 { font-size: 1.7em; margin: 1.5em 0 .6em; color: var(--accent-ink); letter-spacing: -.01em; }
.fv-doc h2 {
  font-size: 1.36em; margin: 1.9em 0 .65em; padding-bottom: .3em; color: var(--accent-ink);
  border-bottom: 1px solid rgba(15, 69, 74, .18);
}
.fv-doc h3 { font-size: 1.15em; margin: 1.6em 0 .5em; }
.fv-doc h4 { font-size: 1em; margin: 1.4em 0 .4em; }
.fv-doc h5, .fv-doc h6 { font-size: .86em; margin: 1.3em 0 .4em; text-transform: uppercase; letter-spacing: .05em; color: var(--hint); }
/* A heading scrolled into view clears the sticky top bar (shell.css .topbar:
   6px + a 34px row + 6px + 1px border, plus the top safe area). The browser
   page has no bar and keeps the plain scroll. */
body:has(.topbar:not([hidden])) .fv-doc :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: calc(47px + var(--safe-top, 0px) + 8px); }
.fv-doc a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.fv-doc strong { font-weight: 700; }
.fv-doc hr { border: 0; border-top: 1px solid var(--rule); margin: 2.2em 0; }
.fv-doc img { max-width: 100%; height: auto; border-radius: 6px; }

.fv-doc ul, .fv-doc ol { margin: 0 0 1.05em; padding-left: 1.45em; }
.fv-doc li { margin: .35em 0; }
.fv-doc li > p { margin: .35em 0; }
.fv-doc li > ul, .fv-doc li > ol { margin: .2em 0 .4em; }
.fv-doc li::marker { color: var(--accent-ink); }
.fv-doc li:has(> input[type=checkbox]) { list-style: none; margin-left: -1.3em; }
.fv-doc li > input[type=checkbox] { margin: 0 .5em 0 0; vertical-align: -1px; }

.fv-doc blockquote {
  margin: 1.3em 0; padding: .75em 1em; color: #3a434a;
  background: #eef4f4; border-left: 3px solid rgba(15, 69, 74, .45); border-radius: 0 10px 10px 0;
}
.fv-doc blockquote > :last-child { margin-bottom: 0; }

.fv-doc code, .fv-doc pre, .fv-text pre { font-variant-ligatures: none; }
.fv-doc code { font-family: var(--mono); font-size: .82em; padding: .12em .36em; border-radius: 5px; background: #eef0f2; }
.fv-doc pre, .fv-text pre {
  font-family: var(--mono); font-size: 13.5px; line-height: 1.55;
  margin: 1.3em 0; padding: 12px 14px; overflow-x: auto;
  background: var(--soft); border: 1px solid var(--rule); border-radius: 10px;
}
.fv-text pre { margin: 0; }
.fv-doc .chroma .err, .fv-text .chroma .err { color: inherit; background: none; }
.fv-doc pre code { font-size: inherit; padding: 0; background: none; border-radius: 0; }

.fv-doc table {
  display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-collapse: collapse; margin: 1.4em 0; font-size: .86em; line-height: 1.45;
}
.fv-doc th, .fv-doc td { padding: .55em .8em; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; min-width: 5em; }
.fv-doc th { background: #e6eeee; color: var(--accent-ink); font-weight: 700; border-bottom: 2px solid rgba(15, 69, 74, .25); }
.fv-doc tbody tr:nth-child(even) { background: #f7f9f9; }
.fv-doc th[align=center], .fv-doc td[align=center] { text-align: center; }
.fv-doc th[align=right], .fv-doc td[align=right] { text-align: right; }

/* Mermaid: source until drawn (and if it cannot be), then a scrollable figure. */
.fv-doc pre.mermaid { white-space: pre; }
.fv-mermaid {
  margin: 1.4em 0; padding: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; text-align: center;
  border: 1px solid var(--rule); border-radius: 10px; background: #fff;
}
.fv-mermaid svg { display: inline-block; max-width: 100%; height: auto; }
.fv-mermaid.fv-wide svg { max-width: none; }
/* Wide content leaves the column (FVLib.addBleeds wraps each top-level table
   and code block): the wrapper spans the page, and its one track is at least
   the column's width and at most the content's natural width, capped by the
   page, centred. Narrow content is the column, aligned with the text; only
   content wider than the window scrolls, inside itself. The block's own
   vertical margin moves to the wrapper, where it collapses with the text's. */
.fv-bleed {
  display: grid; justify-content: center;
  grid-template-columns: minmax(min(100%, 90ch), max-content);
  margin: 1.4em calc(50% - 50cqi);
}
.fv-bleed:has(> pre, > .fv-code) { margin-top: 1.3em; margin-bottom: 1.3em; }
.fv-doc .fv-bleed > *, .fv-doc .fv-bleed > .fv-code > pre { min-width: 0; margin-top: 0; margin-bottom: 0; }
.fv-doc.fv-text > .fv-bleed { margin-top: 0; margin-bottom: 0; }
.fv-mermaid-error { margin: -.9em 0 1.3em; font-family: system-ui, sans-serif; font-size: 12.5px; color: #9a3412; }
/* An HTML document fills the window, edge to edge: it brings its own margins
   and cover, and a sandboxed frame cannot report its height to grow into. */
.fv-frame { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
/* Code blocks: a Copy button beside the <pre>, outside its sideways scroller. */
.fv-code { position: relative; }
.fv-code > pre { padding-top: 32px; }
.fv-copy {
  position: absolute; top: 6px; right: 6px; z-index: 1; padding: 3px 9px; border: 1px solid var(--rule);
  border-radius: 7px; background: rgba(255, 255, 255, .92); color: var(--accent-ink);
  font: 600 12px/1.4 system-ui, sans-serif; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.fv-copy:active { background: #e6eeee; }
.fv-copy-buffer { position: fixed; top: 0; left: -9999px; opacity: 0; }
/* An image a document references that cannot be shown. */
.fv-img-missing {
  display: inline-block; padding: 2px 8px; border: 1px dashed var(--rule); border-radius: 6px;
  color: var(--hint); font-size: .86em; font-style: italic;
}
/* Images and PDFs: fitted to the column, never wider. */
.fv-figure { margin-top: 0; margin-bottom: 0; text-align: center; }
.fv-image { max-width: 100%; height: auto; border-radius: 6px; }
.fv-pdf { display: grid; gap: 10px; }
.fv-pdf-page { width: 100%; background: #fff; box-shadow: 0 0 0 1px var(--rule); border-radius: 2px; }
.fv-pdf-page canvas { display: block; width: 100%; height: auto; }
.fv-pdf-fail { margin: 0; padding: 12px; color: #9a3412; font-size: 13px; }
.fv-pdf-indicator {
  position: fixed; z-index: 15; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + var(--safe-bottom, 0px) + env(safe-area-inset-bottom));
  padding: 3px 10px; border-radius: 12px; background: rgba(31, 35, 40, .72); color: #fff;
  font: 600 12px/1.5 system-ui, sans-serif; pointer-events: none;
}

/* Meetings inherit the shell palette, including Telegram's dark theme. */
.fv-months { display: grid; gap: 16px; }
.fv-month { display: grid; gap: 10px; }
.fv-meeting-card {
  display: block; width: 100%; padding: 16px; border: 1px solid var(--sep);
  border-radius: 12px; background: var(--card); color: var(--fg);
  text-align: left; font: inherit; cursor: pointer; overflow-wrap: anywhere;
}
.fv-meeting-card:hover, .fv-meeting-card:focus-visible { border-color: var(--link); }
.fv-meeting-card:active { filter: brightness(.95); }
.fv-meeting-card h3 { font-size: 17px; margin: 0 0 8px; }
.fv-meeting-card p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; }
.fv-meeting-meta { color: var(--hint); font-size: 13px; line-height: 1.5; }
.fv-meeting-summary { line-height: 1.5; }
.fv-meeting-page { max-width: 90ch; margin: 0 auto; overflow-wrap: anywhere; }
.fv-meeting-page h1 { font-size: 24px; line-height: 1.3; }
.fv-key-points { padding-left: 24px; line-height: 1.6; margin: 20px 0; }
.fv-key-points li { margin: 8px 0; }

.fv-meeting-picker { display: flex; align-items: flex-start; gap: 12px; margin: 12px 0; }
.fv-meeting-year, .fv-month-chips button { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--hint); border-radius: 8px; padding: 8px 10px; }
.fv-month-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fv-month-chips button[aria-pressed="true"] { border-color: var(--link); color: var(--link); font-weight: 600; }
.fv-day-heading { font-size: 18px; margin: 20px 0 4px; padding-bottom: 8px; border-bottom: 2px solid var(--hint); }
