/* WEAVIST demo sites: what a version's wiki.json adds (src/sites-host/wiki-overlay.ts; from
   PR #182's facts overlay).
   Served by the host from this image, like chat.js, so every live version gets the same rules.
   - The image text block (.wv-image-text) sits inside the prospect's mirrored page: its rules
     first revert every page style reaching it and carry three ID-level :not() so the page's own
     selectors lose to them; they select nothing of the page's.
   - The facts page (html.wv-own .wv-facts) is our own page, next to site.css's rules.
   - The chat reply's tables, lists and Google Maps buttons (chat.js, also served from this
     image) are styled here rather than in each version's site.css, so a demo published before
     them shows them styled too. */

.wv-image-text:not(#wv-x):not(#wv-y):not(#wv-z),
.wv-image-text:not(#wv-x):not(#wv-y):not(#wv-z) * {
  all: revert;
  box-sizing: border-box;
}
.wv-image-text:not(#wv-x):not(#wv-y):not(#wv-z) {
  display: block;
  position: relative;
  clear: both;
  width: auto;
  max-width: 100%;
  margin: 12px 0;
  padding: 10px 14px;
  border: 1px solid #d8d8d2;
  border-left: 4px solid #1f4f7a;
  border-radius: 8px;
  background: #f6f6f3;
  color: #1d1d1f;
  font: 14px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Noto Sans TC", "Noto Sans JP", sans-serif;
  text-align: left;
  overflow-wrap: anywhere;
}
.wv-image-text:not(#wv-x):not(#wv-y):not(#wv-z) summary {
  display: list-item;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #5d6066;
}
.wv-image-text:not(#wv-x):not(#wv-y):not(#wv-z) p { margin: 4px 0; }
.wv-image-text:not(#wv-x):not(#wv-y):not(#wv-z) table { border-collapse: collapse; margin: 8px 0; max-width: 100%; }
.wv-image-text:not(#wv-x):not(#wv-y):not(#wv-z) td { border: 1px solid #d8d8d2; padding: 3px 8px; vertical-align: top; }
.wv-image-text:not(#wv-x):not(#wv-y):not(#wv-z) .wv-image-text-note { margin-top: 8px; font-size: 12px; color: #5d6066; }

@media (prefers-color-scheme: dark) {
  .wv-image-text:not(#wv-x):not(#wv-y):not(#wv-z) { background: #1d1d20; color: #f3f3f0; border-color: #3a3a3f; border-left-color: #6fa3d6; }
  .wv-image-text:not(#wv-x):not(#wv-y):not(#wv-z) summary,
  .wv-image-text:not(#wv-x):not(#wv-y):not(#wv-z) .wv-image-text-note { color: #b5b7bd; }
  .wv-image-text:not(#wv-x):not(#wv-y):not(#wv-z) td { border-color: #3a3a3f; }
}

/* The facts page: whole units of the site wiki. */
.wv-own .wv-facts-unreviewed { padding: 8px 12px; border-left: 4px solid #b8860b; background: #fff8e6; color: #5c4400; }
.wv-own .wv-facts-unit { padding: 10px 0; border-bottom: 1px solid var(--wv-border, #e2e2dd); }
.wv-own .wv-unit p { margin: 0 0 4px; }
.wv-own .wv-unit .wv-unit-path { font-size: 13px; color: var(--wv-muted, #5d6066); }
.wv-own .wv-unit ul { margin: 4px 0 4px 20px; }
.wv-own .wv-facts-external { opacity: 0.92; }
.wv-own .wv-facts-label { display: inline-block; margin: 0 0 4px; padding: 1px 8px; border-radius: 999px; background: var(--wv-border, #e2e2dd); font-size: 12px; color: var(--wv-muted, #5d6066); }
.wv-own main.wv-facts { padding-bottom: 140px; }
.wv-own .wv-facts-intro { color: var(--wv-muted, #5d6066); }
.wv-own .wv-facts table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 15px; }
.wv-own .wv-facts th,
.wv-own .wv-facts td { padding: 8px 10px; border-bottom: 1px solid var(--wv-border, #e2e2dd); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.wv-own .wv-facts thead th { font-size: 13px; color: var(--wv-muted, #5d6066); font-weight: 600; }
.wv-own .wv-facts tbody th { width: 28%; font-weight: 600; }
.wv-own .wv-facts .wv-facts-source { font-size: 13px; color: var(--wv-muted, #5d6066); }
.wv-own .wv-faq-item { padding: 12px 0; border-bottom: 1px solid var(--wv-border, #e2e2dd); }
.wv-own .wv-faq-item h3 { margin: 0 0 6px; font-size: 17px; line-height: 1.4; }
.wv-own .wv-faq-item p { margin: 0 0 6px; }

/* A table keeps its header row on every screen (it governs the rows): a narrow screen scrolls
   the table sideways instead of stacking cells without their header. */
.wv-own .wv-unit-table { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.wv-own .wv-unit-table table { width: auto; min-width: 100%; }
.wv-own .wv-unit-table th,
.wv-own .wv-unit-table td { white-space: nowrap; }
}

/* A chat reply's formatting (chat.js richText): paragraphs, lists and a table that scrolls
   sideways inside the bubble on a narrow screen, its header row kept. */
#wv-chat .wv-chat-rich { white-space: normal; }
#wv-chat .wv-chat-rich p { margin: 0 0 6px; }
#wv-chat .wv-chat-rich p:last-child { margin-bottom: 0; }
#wv-chat .wv-chat-rich ul,
#wv-chat .wv-chat-rich ol { margin: 4px 0 6px; padding-left: 20px; }
#wv-chat .wv-chat-rich li { margin: 2px 0; }
#wv-chat .wv-chat-table { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; margin: 6px 0 8px; border: 1px solid var(--wv-border, #e2e2dd); border-radius: 8px; background: var(--wv-bg, #ffffff); }
#wv-chat .wv-chat-table table { border-collapse: collapse; min-width: 100%; font-size: 13px; line-height: 1.4; }
#wv-chat .wv-chat-table th,
#wv-chat .wv-chat-table td { padding: 6px 8px; border-bottom: 1px solid var(--wv-border, #e2e2dd); text-align: left; vertical-align: top; white-space: nowrap; }
#wv-chat .wv-chat-table th { background: var(--wv-surface, #f6f6f3); font-weight: 600; }
#wv-chat .wv-chat-table tr:last-child td { border-bottom: 0; }

/* Google Maps buttons: under a chat reply (chat.js addNavigation; #wv-chat-scoped, as site.css
   reverts every rule inside #wv-chat) and after an address on the facts page (wiki-overlay.ts). */
#wv-chat .wv-chat-nav,
.wv-own .wv-facts-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 10px 0 2px; }
#wv-chat .wv-chat-nav-address { flex-basis: 100%; font-size: 13px; color: var(--wv-muted, #5d6066); }
#wv-chat .wv-chat-nav .wv-chat-nav-go,
.wv-own .wv-facts-nav .wv-facts-nav-go { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--wv-accent, #1f4f7a); color: var(--wv-accent-text, #ffffff); font-size: 13.5px; font-weight: 600; text-decoration: none; }
#wv-chat .wv-chat-nav .wv-chat-nav-map,
.wv-own .wv-facts-nav .wv-facts-nav-map { font-size: 13px; }

/* AIO / GEO pages at /insights (src/sites-host/insights.ts): our own pages, no mirrored markup. */
.wv-insight {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  color: #1d1d1f;
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Noto Sans TC", "Noto Sans JP", sans-serif;
}
.wv-insight h1 { font-size: 28px; line-height: 1.3; margin: 0 0 16px; }
.wv-insight h2 { font-size: 20px; margin: 28px 0 8px; }
.wv-insight-answer { padding: 14px 18px; border-left: 4px solid #1f4f7a; background: #f6f6f3; border-radius: 8px; }
.wv-insight-answer p { margin: 0 0 6px; }
.wv-insight-preview { padding: 8px 12px; background: #fffbeb; border: 1px solid #d97706; border-radius: 6px; font-size: 14px; }
.wv-insight-table { width: 100%; margin: 24px 0; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.wv-insight-table caption { text-align: left; font-weight: 700; margin-bottom: 8px; }
.wv-insight-table th, .wv-insight-table td { border: 1px solid #d8d8d2; padding: 8px 10px; text-align: left; vertical-align: top; }
.wv-insight-table thead th { background: #f0f0ec; }
.wv-insight sup { font-size: 11px; margin-left: 2px; }
.wv-insight-updated { color: #5d6066; font-size: 14px; margin-top: 28px; }
.wv-insight-sources { font-size: 14px; color: #3d4045; }
.wv-insight-sources a { color: #1f4f7a; overflow-wrap: anywhere; }
