:root {
  --bg: #ffffff;
  /* Scrapbox's own layout: the page body (title + content) sits as a
     white "card" on a tinted page background, not the other way around --
     see #editor/#ref-view below. */
  --page-bg: #eef0f2;
  --fg: #1a1a1a;
  --muted: #8a8a8a;
  --border: #e3e3e3;
  --link: #0b6fbf;
  --accent: #eef6ff;
  --link-missing: #b23b3b;
  --link-external: #1a7f37;
  --code-bg: #f0f1f3;
  --quote-border: #a0a0a0;
  --quote-bg: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1c1d;
    --page-bg: #131415;
    --fg: #e8e8e8;
    --muted: #8a8a8a;
    --border: #333;
    --link: #6cb6ff;
    --accent: #22303d;
    --link-missing: #e08080;
    --link-external: #4ada6f;
    --code-bg: #262a30;
    --quote-border: #5c6169;
    --quote-bg: rgba(255, 255, 255, 0.06);
  }
}

* { box-sizing: border-box; }

/* Both html and body: which one is the actual root scroller varies by
   browser, and mobile Safari's elastic overscroll can still rubber-band
   sideways off just the body's overflow-x:hidden. width: 100% keeps a
   position:fixed descendant (like .status-bar) from being able to expand
   this box past the viewport in the first place. */
html {
  overflow-x: hidden;
  width: 100%;
  /* overflow-x:hidden stops programmatic/wheel scroll, but mobile Safari's
     elastic touch-drag rubber-band can still visibly bounce sideways on a
     swipe even with no real overflow. touch-action tells the browser to
     only ever treat touch drags as vertical panning, which is the more
     direct fix for that specific symptom. */
  touch-action: pan-y;
}

body {
  margin: 0;
  width: 100%;
  touch-action: pan-y;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--page-bg);
  color: var(--fg);
  overflow-x: hidden;
}

/* position: fixed, not sticky -- html and body both need overflow-x:hidden
   for an unrelated mobile-Safari rubber-band fix (see the comment above),
   and that combination forces both of them into being their own scroll
   container (CSS Overflow's "visible paired with non-visible becomes
   auto" rule), which left a sticky topbar's containing block ambiguous
   and made it scroll away with the page instead of sticking. Fixed
   sidesteps that outright. left/right (not width/max-width) for the same
   real-vs-visual-viewport reason as .status-bar below. #app's padding-top
   reserves the space this removes from the flow. */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--page-bg);
  z-index: 10;
}

#app {
  padding-top: 52px;
}

/* Search footer: height is pinned (not content-sized) so the status bar
   and .content's bottom padding can stack on top of it via --footer-h
   without JS measuring it. --kb is the on-screen keyboard's covered
   height (set from visualViewport in app.ts). */
:root {
  --footer-h: calc(51px + env(safe-area-inset-bottom));
}
.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  height: var(--footer-h);
  padding: 8px 10px env(safe-area-inset-bottom);
  background: var(--page-bg);
  border-top: 1px solid var(--border);
  transform: translateY(calc(-1 * var(--kb, 0px)));
}
@media (min-width: 900px) {
  .bottombar { justify-content: center; }
  .bottombar .quick-open-row { max-width: 640px; }
}

.brand {
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}

.quick-open-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.quick-add {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.quick-add:hover {
  opacity: 0.8;
}

.quick-open-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.quick-open {
  width: 100%;
  height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font-size: 16px; /* see .page-edit: avoids iOS Safari's zoom-on-focus */
}

/* The footer search box's own hit-page dropdown (Scrapbox shows this on
   every page, not just a dedicated search results page) -- see
   wireQuickOpen/searchQuickOpen in app.ts. Opens upward since the box is
   at the bottom of the screen. */
.quick-open-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 15;
}
.quick-open-dropdown[hidden] { display: none; }

.quick-open-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  color: var(--fg);
  text-decoration: none;
}
.quick-open-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-open-item-source {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
}
.quick-open-item:hover,
.quick-open-item.is-selected {
  background: var(--accent);
}

/* Pushes the icon group to the topbar's right edge. */
.topbar nav {
  margin-left: auto;
}

.topbar nav a,
.topbar nav button.nav-btn {
  margin-left: 12px;
  color: var(--fg);
  text-decoration: none;
  opacity: 0.8;
}
.topbar nav a:hover,
.topbar nav button.nav-btn:hover { opacity: 1; }
.topbar nav button.nav-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.content {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px calc(80px + var(--footer-h));
}

/* The page body itself (editable or read-only reference) as a white card
   against the tinted page background -- so it's clear at a glance where
   the actual page content starts and ends, vs. surrounding chrome like
   the merge banner or the backlinks section below it. */
#editor,
#ref-view {
  min-height: 4em;
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 16px;
}

#editor { cursor: text; }

.merge-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--link);
  border-radius: 6px;
  background: var(--accent);
  font-size: 13px;
}
.merge-banner span { flex: 1 1 auto; min-width: 180px; }
.merge-banner button {
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--link);
  background: var(--link);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.merge-banner button.secondary {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.ref-banner {
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--accent);
  color: var(--muted);
  font-size: 13px;
}

.linked {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.linked h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.linked ul { list-style: none; padding: 0; margin: 0; }
.linked li { margin-bottom: 6px; }

.home-ref-section {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sort-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  font-size: 12px;
  color: var(--muted);
}
.sort-select {
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: 12px;
}

/* Scrapbox-style page list: square cards, title + as much body text as
   fits, image thumbnails not implemented (see chat) */
.page-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
@media (max-width: 480px) {
  .page-cards { grid-template-columns: repeat(3, 1fr); }
}

/* Invisible trigger for infinite-scroll card loading (see
   mountInfiniteCards in app.ts) -- height gives IntersectionObserver
   something to fire on slightly before it's actually scrolled into view. */
.page-cards-sentinel {
  height: 1px;
}

.page-card {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
  overflow: hidden;
}
.page-card:hover { background: var(--accent); }

/* →/←/⇔ on a 1-hop linked-page card -- see pageCardsHtml() in app.ts. */
.page-card-dir {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 12px;
  line-height: 1;
  opacity: 0.6;
}

.page-card-title {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.page-card-desc {
  flex: 1;
  font-size: 11.5px;
  line-height: 1.4;
  opacity: 0.7;
  overflow: hidden;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
}

a { color: var(--link); }
.muted { color: var(--muted); font-size: 13px; }

/* Headings are just bold section labels here, not a size hierarchy --
   the browser's default large heading sizes are turned off so they read
   as emphasis rather than jumping out as display text. */
h1, h2, h3 {
  font-size: 1em;
  font-weight: 700;
}

.line-view {
  padding: 3px 6px;
  border-radius: 4px;
  /* Matched against .edit-layer's line-height so a line's rendered height
     doesn't visibly jump when switching between view and edit mode. */
  line-height: 1.4;
  font-size: 15px;
  cursor: text;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.4em;
}
.line-view.line-title {
  /* Bold-only, not larger -- a bigger font here than the edit-mode
     textarea's 16px (see .page-edit) makes the line reflow height jump
     when switching between view and edit, shifting the whole page. */
  font-weight: 700;
  margin-bottom: 6px;
}
.line-view:hover { background: var(--accent); }
.line-view:empty::before { content: '\00a0'; }

.indent-bullet {
  display: inline-block;
  width: 1em;
  margin-right: 0.2em;
  text-align: center;
  color: var(--muted);
  user-select: none;
}

/* Edit mode is two stacked layers in .edit-wrap: the real <textarea>
   (.page-edit) on top handles all actual input/selection/caret, with its
   own text and background made invisible; a plain, non-interactive
   .edit-backdrop div sits directly behind it showing the *same* text with
   whitespace/indent decoration (see editor.ts's renderEditBackdrop()).
   Both share .edit-layer for byte-identical box model + font, which is
   what keeps their line-wrapping pixel-identical -- any mismatch there
   would make the two layers visibly drift apart. */
.edit-wrap {
  position: relative;
  border: 1px solid var(--link);
  border-radius: 4px;
  background: var(--accent);
}

.edit-layer {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 4em;
  margin: 0;
  padding: 3px 6px;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  /* Must be >= 16px: iOS Safari auto-zooms the page on focusing any
     input/textarea with a smaller font size (to make the text legible),
     and never zooms back out on blur — which is what was causing the
     "page can suddenly be swiped sideways" bug after editing. */
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 4;
  /* Widens every space character itself (not just the backdrop's dot
     markers) -- on the shared class so it applies identically to the real
     textarea and the backdrop, keeping their layout in sync. A per-
     character width (e.g. only the leading indent's spaces) isn't
     reachable this way -- word-spacing is uniform across an element, and
     a native <textarea> has no way to style individual characters
     differently at all -- but widening every space still makes a run of
     N leading spaces N times as much wider, which is the concrete "1
     space vs. 2" problem this is for. */
  word-spacing: 0.3em;
}

.edit-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  color: var(--fg);
}

.page-edit {
  position: relative;
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: var(--fg);
  overflow: hidden;
}
.page-edit:focus { outline: none; }

/* Whitespace markers in the backdrop -- ::after is absolutely positioned
   (no layout footprint of its own) so decorating a space can never change
   that space's width/wrapping relative to the same character in the real
   textarea underneath. */
.ws-mark { position: relative; }
.ws-mark::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.ws-space::after {
  width: 0.22em;
  height: 0.22em;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.6;
}
/* Full-width space: a common, easy-to-miss typo when it lands where a
   half-width space was intended (they count as the same "one indent
   level" per parser.ts's splitIndent, but look identical unmarked) --
   deliberately a different shape *and* color from a half-width space so
   the two are never confused for one another. */
.ws-ideospace::after {
  width: 0.5em;
  height: 0.5em;
  border-radius: 2px;
  background: var(--link-missing);
  opacity: 0.35;
}
.ws-tab::after {
  content: '\2192';
  width: auto;
  height: auto;
  font-size: 0.8em;
  color: var(--muted);
  opacity: 0.7;
}
/* The leading indentation run specifically (vs. whitespace later in the
   line) -- box-shadow, not border, so it paints without adding to the
   element's box size (a border would, which would desync the backdrop's
   wrapping from the textarea's). One continuous-looking vertical guide
   per depth level falls out naturally: every line's Nth leading space
   sits at the same horizontal position, because space width is constant
   for a given font/size even in a proportional font. */
.ws-indent { box-shadow: inset 1px 0 0 var(--border); }

/* Floating popup shown near a text selection while editing (Scrapbox's
   "select text -> act on it" pattern). position:fixed + JS-set top/left,
   see editor.ts's updateSelectionToolbar(). */
.selection-toolbar {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 6px;
  background: var(--fg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 20;
}
.selection-toolbar-btn {
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--bg);
  padding: 6px 10px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.selection-toolbar-btn:hover,
.selection-toolbar-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

/* Link color-coding is a scrapbox-tycoon convention, not part of real
   Scrapbox: green external links get a trailing arrow, missing internal
   links get a dashed red underline, so a bad/typo'd link is visible before
   you click it. Ported from scrapbox-pwa-viewer's style.css. */
a.link {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a.link:hover { border-bottom-color: var(--link); }
a.link.strong { font-weight: 700; }
a.link.tag::before { content: "#"; opacity: 0.6; }
a.link.missing { color: var(--link-missing); border-bottom: 1px dashed var(--link-missing); }
a.link.external { color: var(--link-external); }
a.link.external:hover { border-bottom-color: var(--link-external); }
a.link.external::after { content: " \2197"; font-size: 0.75em; opacity: 0.6; }

code.inline-code {
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}

pre.sb-code {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  margin: 6px 0;
  white-space: pre;
}
pre.sb-code .lang {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

table.sb-table {
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 13px;
}
table.sb-table td { border: 1px solid var(--border); padding: 4px 8px; }
table.sb-table caption { text-align: left; color: var(--muted); font-size: 11px; margin-bottom: 4px; }

/* Scrapbox's own quote styling is `.line .quote` -- a per-line modifier,
   not a separate block with its own spacing -- so this stays flush with
   .line-view's own padding/margin (none) rather than adding its own, and
   only insets the left edge a little further for the border. */
blockquote.sb-quote {
  display: block;
  margin: 0;
  padding: 3px 6px 3px 9px;
  background-color: var(--quote-bg);
  border-left: 1px solid var(--quote-border);
  color: var(--muted);
}

.sb-strong { font-weight: 700; }
.sb-em { font-style: italic; }
.sb-strike { text-decoration: line-through; }
.sb-underline { text-decoration: underline; }
.sb-h1 { font-size: 1.5em; font-weight: 700; display: inline-block; }
.sb-h2 { font-size: 1.3em; font-weight: 700; display: inline-block; }
.sb-h3 { font-size: 1.15em; font-weight: 700; display: inline-block; }

/* ---------- extended decoration syntax ([X text], ported from
   scrapbox-pwa-viewer, itself carried over from the source Scrapbox
   project's settings-page custom CSS) ---------- */

/* Shared by every "badge" decoration below (.deco-\< / \> / \!). Three fix
   attempts at giving this an independent box (inline-block with various
   width/word-break overrides, then inline-flex) all still collapsed on
   the actual device where this was reported broken -- confirmed visually
   fine there with plain display: inline instead, so that's what this is
   now. inline never creates its own shrink-to-fit/flex sizing context in
   the first place, which is what every earlier attempt was fighting under
   Safari with word-break: break-word up the tree (see .line-view). The
   trade-off is losing vertical-align/align-items centering control, not
   needed here since the padding is modest and the label is always a
   single short word/phrase; white-space: nowrap keeps that phrase from
   ever being split mid-badge by a line wrap. */
.deco-\<,
.deco-\>,
.deco-\! {
  display: inline;
  white-space: nowrap;
  font-size: 0.85em;
  line-height: 1.3;
  padding: 0.15em 0.5em;
  margin: 0 2px;
  border-radius: 4px;
}

/* [< xxx] -> keycap-style */
.deco-\< {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border: 1px solid var(--border);
  background: var(--code-bg);
  box-shadow: inset 0 -1px 0 var(--border);
}

/* [> xxx] -> menu-path style */
.deco-\> {
  border: 1px solid var(--border);
  background: var(--accent);
}

/* [" xxx] -> quote */
.deco-\" { display: inline; padding-left: 4px; }
.deco-\"::before { content: "\275D "; color: var(--muted); }
.deco-\"::after { content: " \275E"; color: var(--muted); }

/* [! xxx] -> timestamp badge */
.deco-\! {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code-bg);
  color: var(--muted);
}

/* [# xxx] -> small raised aside */
.deco-\# { font-size: 0.75em; vertical-align: text-top; }
.deco-\#::before { content: "[\2020"; }
.deco-\#::after { content: "]"; }

.img-embed {
  display: block;
  max-width: 100%;
  margin: 6px 0;
  border-radius: 6px;
}
.img-embed img { max-width: 100%; border-radius: 6px; display: block; }
.img-embed .img-caption { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* [~ [url]] -> mini inline image/icon instead of a full embed */
.deco-\~ .img-embed {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin: 0 2px;
  overflow: hidden;
  vertical-align: middle;
}
.deco-\~ .img-embed img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; }
.deco-\~ .img-embed .img-caption { display: none; }

/* Anchored to both left AND right (not a vw-based width/max-width), so the
   browser computes the available width directly from the real viewport —
   `100vw` can be wider than the visual viewport on mobile Safari, which
   caused both a horizontal-scroll and a badge-overlap bug here. */
.status-bar {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + var(--footer-h));
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  pointer-events: none;
}

.sync-status {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
  color: var(--muted);
}

.backend-badge,
.build-info {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
  color: var(--muted);
}

/* Reused in-flow at the top of the notes/reference lists too, not just
   the fixed footer -- see renderPageList()/renderReferenceList(). It's an
   <a> to the repo when sync is on (see syncInfoHtml() in app.ts), so it
   needs its own text-decoration reset rather than relying on the plain
   `a` rule. */
.backend-badge {
  background: var(--accent);
  padding: 3px 8px;
  border-radius: 10px;
  flex-shrink: 1;
  text-decoration: none;
}
.backend-badge:hover { text-decoration: underline; }

/* The connection line atop the notes list (repo link, page count, last
   synced commit+time, [Modified] flag) -- see syncInfoHtml() in app.ts.
   Wraps to two lines on narrow screens via .sync-line-break rather than
   flex-direction: column, so it stays a single line on desktop without a
   separate layout branch. */
.sync-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.sync-line-break { display: none; }
.sync-commit { font-variant-numeric: tabular-nums; }
.sync-modified { color: var(--link-missing); font-weight: 700; }

/* Per-page debug line (see renderPage() in app.ts): this page's own
   `updated` timestamp next to the store-wide last-synced commit+time, so a
   suspected sync-timing mismatch can be spotted without leaving the page.
   Sits right above the editor; kept to one line (ellipsized rather than
   wrapped) even on a narrow phone screen. */
.sync-page-line {
  margin-bottom: 8px;
  font-size: 11px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .sync-line-break { display: block; width: 100%; }
}

.build-info {
  opacity: 0.6;
  flex-shrink: 0;
}

.settings label {
  display: block;
  margin: 10px 0 4px;
}
.settings input[type="text"], .settings input:not([type="radio"]):not([type="checkbox"]):not([type="file"]) {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
  width: 100%;
  max-width: 420px;
  font-size: 16px; /* see .page-edit: avoids iOS Safari's zoom-on-focus */
}
.settings button {
  margin-top: 14px;
  padding: 8px 16px;
  border: 1px solid var(--link);
  background: var(--link);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}
.settings button.secondary {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

/* Sync-conflict variant of the merge banner: louder border, plus the line
   diff vs the original page. */
.conflict-banner { border-color: var(--link-missing); }
.conflict-result.same { color: var(--link-external); }
.conflict-result.differ { color: var(--link-missing); }
.conflict-diff {
  flex: 1 1 100%;
  max-height: 50vh;
  overflow: auto;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}
.conflict-diff[hidden] { display: none; }
.conflict-diff .diff-added { display: block; background: rgba(26, 127, 55, 0.18); }
.conflict-diff .diff-removed { display: block; background: rgba(178, 59, 59, 0.18); }
.conflict-diff .diff-same { display: block; color: var(--muted); }

.page-actions { margin: 16px 0 0; text-align: right; }
.page-actions button.danger {
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--link-missing);
  background: transparent;
  color: var(--link-missing);
  font-size: 13px;
  cursor: pointer;
}
