/* The app's single-purpose pages (sign-in, keys and Emergency Kit, the
   viewer, admin, security, privacy) on madal's design system. The tokens and
   components come from ui.css; this file only lays out these pages and keeps
   the class names their HTML and scripts already use. */
@import url("ui.css");

/* Older names, kept so page scripts and markup don't change. */
:root {
  --line: var(--border);
  --soft: var(--surface-2);
  --card: var(--surface);
  --error: var(--danger);
  --amber: var(--warning);
  --amber-bg: var(--warning-soft);
}

/* --- Text ---------------------------------------------------------------- */

.small { font-size: var(--text-sm); margin: 0; }
.error { color: var(--danger); }
.lede { font-size: var(--text-lg); }

/* --- Single-card pages: sign-in, keys, done ---------------------------- */

body.page { align-items: center; padding: max(9vh, env(safe-area-inset-top)) max(clamp(12px, 4vw, 16px), env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(clamp(12px, 4vw, 16px), env(safe-area-inset-left)); }
.page .card {
  width: 100%; max-width: 680px; padding: clamp(20px, 6vw, 28px); display: grid; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.page .card.narrow { max-width: 420px; }
.page .card h1 { font-size: var(--text-xl); margin: 0; }
/* The wordmark (ui.css), a size up at the top of a card page. */
.page .card > .wordmark { justify-self: start; font-size: 1.25rem; letter-spacing: -0.03em; margin-bottom: 6px; }
.stack form { margin-top: 4px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--text-xs); margin: 4px 0; text-transform: uppercase; letter-spacing: 0.06em; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.account { margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--border); }

/* Prose pages (security, privacy) read as documents, not boxes. */
.page .card.prose { background: transparent; border: 0; box-shadow: none; padding: 0; max-width: 720px; display: block; }
.prose { line-height: 1.7; font-size: var(--text); }
.prose h1 { font-size: var(--text-2xl); margin-bottom: 8px; }
.prose h1 .beta { margin-left: 6px; vertical-align: 0.3em; letter-spacing: 0.06em; text-transform: uppercase; }
.beta-note { margin: 0 0 16px; padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); font-size: var(--text-sm); }
.prose h2 { font-size: var(--text-lg); margin: 30px 0 8px; }
.prose p, .prose ul, .prose pre { margin: 0 0 12px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 5px 0; }
.prose pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; font-size: var(--text-sm); }
.prose code { font-size: var(--text-xs); }
.prose pre code { background: none; border: 0; padding: 0; }
p.callout { display: block; border: 0; border-left: 3px solid var(--warning); background: var(--warning-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 12px 14px; margin: 16px 0; }
p.callout strong { color: var(--warning); }

/* --- Emergency Kit ------------------------------------------------------ */

.kit-card { border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); padding: 14px 16px; display: grid; gap: 6px; }
/* ui-rules-allow: the Secret Key stays on one line, so it scales with the window */
.kit-sk { font: 600 clamp(11.5px, 3.4vw, 14px) var(--mono); white-space: nowrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 6px 8px; justify-self: start; }
.kit-blank { display: inline-block; min-width: 14em; border-bottom: 1px solid var(--border-strong); }
.kit-ways { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.kit-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kit-actions button { width: auto; flex: 0 0 auto; }
@media print {
  body * { visibility: hidden; }
  .kit-card, .kit-card * { visibility: visible; color: #000; }
  .kit-card .print-hide { display: none; }
  .kit-card p { margin: 6px 0; }
  html, body, .card, .kit-card { background: #fff !important; box-shadow: none !important; }
  .kit-card .kit-blank { border-bottom-color: #000; min-width: 22em; }
  .kit-card { position: absolute; left: 24px; top: 24px; right: 24px; border-color: #000; }
}
.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; }

/* --- Viewer ------------------------------------------------------------- */

/* The viewer runs edge to edge (viewport-fit=cover): the bar clears the
   status bar and the notch, and the page frame the notch when the phone is
   held sideways. */
body.viewer { background: var(--bg); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
body.viewer > .bar { padding-top: max(8px, env(safe-area-inset-top)); }
.bar {
  /* Gaps and side padding narrow with the window, down to 4px and 8px on
     the smallest phones, so every control stays on one row. */
  display: flex; align-items: center; gap: clamp(4px, 1.5vw, 12px); padding: 8px clamp(8px, 2.5vw, 16px); min-height: 50px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
/* "← Pages", back to the dashboard for someone who opened the page from it.
   On phones it is just the arrow, a 44px target, so the bar stays one row. */
.bar .to-pages { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: var(--text-xs); font-weight: 550; color: var(--muted); white-space: nowrap; text-decoration: none; }
.bar .to-pages .icon { width: 14px; height: 14px; }
@media (pointer: coarse) { .bar .to-pages { min-height: 44px; } }
.bar .to-pages:hover { color: var(--fg); }
.bar .to-pages:focus-visible { box-shadow: var(--ring); outline: 2px solid transparent; outline-offset: 2px; border-radius: var(--radius-xs); }
.bar .wordmark { font-size: 1rem; letter-spacing: -0.03em; }
.bar .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.bar .by, .bar .expires { font-size: var(--text-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .by { max-width: 30%; }
.bar .tier {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; border-radius: 999px;
  color: var(--success); background: var(--success-soft);
}
.bar button { min-height: 30px; padding: 0 11px; font-size: var(--text-xs); }
/* The way to get madal for a reader: it goes to the home page's install
   component rather than repeating a command here. */
.bar .cta { flex: none; font-size: var(--text-xs); font-weight: 550; color: var(--accent); white-space: nowrap; text-decoration: none; }
.bar .cta:hover { text-decoration: underline; text-underline-offset: 3px; }
.bar .cta:focus-visible { box-shadow: var(--ring); outline: 2px solid transparent; outline-offset: 2px; border-radius: var(--radius-xs); }
/* On a phone the bar has no room for it without a second row; the brand
   still goes to the home page, where install is the first thing. */
@media (width <= 40em) { .bar .cta { display: none; } }
.bar .versions { height: auto; font: var(--text-xs) var(--mono); color: var(--fg); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 6px; width: auto; min-height: 30px; box-shadow: none; }
/* The reminder under the bar is a quieter banner (ui.css). */
.notice { min-height: 30px; font-size: var(--text-xs); color: var(--muted); }
.bar .tier { cursor: pointer; }
.bar .tier .icon { width: 14px; height: 14px; }
/* A meeting's status (viewer-meeting.js), after the lock. On a phone the
   notice under the bar says it, so the title keeps the room. */
.bar .meeting-status { flex: none; white-space: nowrap; }
@media (width <= 40em) { .bar .meeting-status { display: none; } }
.bar .tier:focus-visible { box-shadow: var(--ring); outline: 2px solid transparent; outline-offset: 2px; }
.notice.warn { color: var(--on-danger); background: var(--danger); border-color: var(--danger); font-weight: 600; }
.artifact { flex: 1; width: 100%; border: 0; background: var(--canvas); }
.comments-list { flex: 1; overflow-y: auto; padding: 8px 16px; }
/* A thread reads like a chat: the reader's own comments on the right, everyone
   else's on the left, each person's in a very light version of their colour. */
.comment {
  align-self: flex-start; max-width: 88%; padding: 8px 12px; background: var(--hl-soft, var(--surface-2));
  border-radius: 14px 14px 14px 4px;
}
.comment.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; }
.comment.mine .dot { display: none; }
.comment.hl-0 { --hl: var(--hl-0); --hl-solid: var(--hl-solid-0); --hl-soft: var(--hl-soft-0); }
.comment.hl-1 { --hl: var(--hl-1); --hl-solid: var(--hl-solid-1); --hl-soft: var(--hl-soft-1); }
.comment.hl-2 { --hl: var(--hl-2); --hl-solid: var(--hl-solid-2); --hl-soft: var(--hl-soft-2); }
.comment.hl-3 { --hl: var(--hl-3); --hl-solid: var(--hl-solid-3); --hl-soft: var(--hl-soft-3); }
.comment.hl-4 { --hl: var(--hl-4); --hl-solid: var(--hl-solid-4); --hl-soft: var(--hl-soft-4); }
.comment.hl-5 { --hl: var(--hl-5); --hl-solid: var(--hl-solid-5); --hl-soft: var(--hl-soft-5); }
.comment.hl-6 { --hl: var(--hl-6); --hl-solid: var(--hl-solid-6); --hl-soft: var(--hl-soft-6); }
.comment > header { display: flex; align-items: center; gap: 6px; min-height: 24px; min-width: 0; font-size: var(--text-sm); }
.comment .author-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment .when { flex: none; }
.comment .acts { flex: none; }
.comment .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; min-width: 0; }
.comment .tags .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment .tags .resolved-badge { min-width: 0; }
.resolved-badge .trunc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment .dot, .comment-tip-row .dot { flex: none; }
.comment-tip-row b { overflow-wrap: anywhere; }
.comment .when { font-size: var(--text-xs); color: var(--muted); }
/* Delete sits at the far end of the header, and shows on hover or focus. */
.comment .acts { margin-left: auto; opacity: 0; transition: opacity 0.12s; }
.comment:hover .acts, .comment:focus-within .acts { opacity: 1; }
@media (hover: none) { .comment .acts { opacity: 1; } }
.comment .acts .btn { min-height: 24px; height: 24px; width: 24px; padding: 0; }
.comment p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
:is(.comments-panel, .comment-card) blockquote {
  margin: 6px 0; padding: 2px 8px; border-left: 2px solid var(--border-strong); background: none;
  font-size: var(--text-sm); color: var(--fg-2); max-height: 6em; overflow: hidden; overflow-wrap: anywhere;
}
:is(.comments-panel, .comment-card) blockquote.jump { cursor: pointer; }
.comments-compose { display: grid; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.comments-compose .row { display: flex; justify-content: space-between; }
.comments-quote { display: flex; align-items: flex-start; gap: 6px; }
.thread { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.reply-box { display: flex; align-items: stretch; gap: 6px; margin-top: 2px; }
.reply-box textarea { flex: 1; min-width: 0; height: 36px; min-height: 36px; padding: 8px 10px; resize: none; }
.reply-box .btn { height: auto; min-height: 36px; }
.comment-card {
  position: fixed; z-index: 13; width: 340px; max-width: calc(100vw - 16px); max-height: min(70vh, 520px); max-height: min(70dvh, 520px); overflow-y: auto; padding: 4px 12px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.comment-card > header { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 2px; }
.comment-card .thread { border-bottom: 0; padding-top: 6px; }
.comment-card .compose { display: grid; gap: 8px; padding-top: 6px; }
.comment-card .compose textarea { min-height: 72px; resize: vertical; }
.comment-card .compose .row { display: flex; justify-content: flex-end; gap: 6px; }
.comment-chip { position: fixed; z-index: 12; box-shadow: var(--shadow-lg); }
/* @mentions: the list of org members under the comment box being typed in,
   and a mentioned name in a posted comment. */
.mention-pop {
  position: fixed; z-index: 30; max-width: calc(100vw - 16px); padding: 4px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.mention-option { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: var(--text-sm); min-width: 0; }
.mention-option span { font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-option.active, .mention-option:hover { background: var(--accent-soft); }
.comment .mention { font-weight: 600; color: var(--accent); }
.comment .mention.me { background: var(--accent-soft); border-radius: var(--radius-xs); padding: 0 2px; }
/* Phones: the thread opens as a sheet along the bottom, and the panel takes the
   whole width under the bar. */
@media (width <= 40em) {
  /* !important: the sheet wins over a position set in code for a wider
     screen, as when a window is resized with a card open. */
  .comment-card {
    left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; max-width: none; max-height: 75vh; max-height: 75dvh;
    border-radius: 16px 16px 0 0; border-bottom: 0; padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  /* The panel is a sheet over the bottom of the screen, so the page and
     whatever is being marked stay in view above it. */
  /* Comments leaves a little more of the page in view than History. */
  .comments-panel { height: 66vh; height: 66dvh; }
  .comment { max-width: 92%; }
  .comments-toggle { padding: 0 8px; }
}
.comments-quote blockquote { flex: 1; }
.comment-pins .comment-pin, .comment-region, .comment-drag { position: fixed; z-index: 11; }
.comment-region, .comment-drag { pointer-events: none; border-radius: 4px; }
.comment-region { border: 2px solid var(--hl-solid); background: none; z-index: 10; }
/* Marks are outlines only, so the page under them reads unchanged. */
.comment-drag { border: 2px dashed var(--accent); background: none; }
.comment-region.draft { border: 2px dashed var(--accent); background: none; }
.comment-pin.draft { width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px dashed var(--accent); }
.comment-region.resized { border-style: dashed; }
/* Resolved threads stay visible but quiet: a thin grey outline, a faded
   marker, and a dimmed thread in the panel. */
.comment-region.resolved { border: 1px dashed var(--border-strong); }
.comment-pin.resolved { opacity: 0.45; }
.thread.resolved .comment { opacity: 0.6; }
.thread.resolved .comment:hover { opacity: 1; }
/* Comments, History and ⋯ never shrink; the title gives way instead. */
.bar .comments-toggle, .bar .menu-wrap { flex: none; }
/* A crowded bar wraps rather than squeezing: the title keeps some room, and
   "Shared by" (with its email, which readers check) and the expiry move to
   their own row rather than being cut short. Pages without them stay on one
   row. */
.bar .title { min-width: 6em; }
@media (width <= 90em) {
  .bar { flex-wrap: wrap; row-gap: 6px; }
  .bar .by { order: 10; flex: 1 1 100%; max-width: none; min-width: 0; }
  .bar .expires { order: 11; }
}
/* The ⋯ menu: the version picker on phones, then the less used actions. */
.bar #more { width: 30px; padding: 0; }
.bar .menu { min-width: 220px; }
/* Menu entries are rows, not the bar's buttons. */
.bar .menu button.item { justify-content: flex-start; min-height: 0; box-shadow: none; white-space: nowrap; }
.bar .menu button.item:disabled { opacity: 0.5; }
.menu-version { padding: 4px 4px 2px; }
.bar .menu-version .versions { width: 100%; max-width: none; }
/* Tablets and phones: Comments and History are icons (Comments keeps its
   count), so the title has room. */
@media (width <= 64em) {
  .bar .history-toggle { font-size: 0; gap: 0; padding: 0; min-width: 30px; justify-content: center; }
  .bar .comments-toggle { gap: 4px; padding: 0 10px; }
}
/* Phones: the title, the lock, Comments and History as icons, and ⋯. The
   brand and the version picker give their room to the title (the picker
   moves into ⋯), and every control is a 44px touch target. */
@media (width <= 40em) {
  .bar .wordmark { display: none; }
  .bar .to-pages { min-width: 44px; min-height: 44px; }
  .bar .to-pages .label { display: none; }
  .bar .to-pages .icon, .bar .history-toggle .icon, .bar .comments-toggle .icon, .bar #more .icon { width: 18px; height: 18px; }
  .bar :is(.tier, .history-toggle, .comments-toggle, #more) { min-height: 44px; min-width: 44px; }
  .menu-version .versions { min-height: 44px; }
  .bar .menu { min-width: 240px; }
}
/* Phones: the title may shrink further, so "← Pages", the lock, Comments,
   History and ⋯ still fit on one row on the smallest. */
@media (width <= 40em) { .bar .title { min-width: 2.5em; } }
@media (width <= 40em), (pointer: coarse) {
  .bar .menu :is(a, button.item) { min-height: 44px; }
}
/* A region pulses, and a bubble gets a ring, when its comment is clicked. */
.comment-region.flash { animation: comment-pulse 0.6s ease-out 2; }
@keyframes comment-pulse { from { box-shadow: 0 0 0 0 var(--hl-solid); } to { box-shadow: 0 0 0 14px transparent; } }
.comment { cursor: pointer; transition: box-shadow 0.2s; }
.comment.active { box-shadow: 0 0 0 2px var(--hl-solid, var(--accent)); }
@media (prefers-reduced-motion: reduce) {
  .comment-region.flash { animation: none; outline: 3px solid var(--hl-solid); outline-offset: 2px; }
  .comment { transition: none; }
}
.comment-tip-row { overflow-wrap: anywhere; }
.comment-tip-row .dot { display: inline-block; margin-right: 6px; }
.comment-tip-row .tip-resolved { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: var(--text-xs); color: var(--success); }
.comment-tip-row.hl-0, .comment-pin.hl-0, .comment-region.hl-0 { --hl: var(--hl-0); --hl-solid: var(--hl-solid-0); }
.comment-tip-row.hl-1, .comment-pin.hl-1, .comment-region.hl-1 { --hl: var(--hl-1); --hl-solid: var(--hl-solid-1); }
.comment-tip-row.hl-2, .comment-pin.hl-2, .comment-region.hl-2 { --hl: var(--hl-2); --hl-solid: var(--hl-solid-2); }
.comment-tip-row.hl-3, .comment-pin.hl-3, .comment-region.hl-3 { --hl: var(--hl-3); --hl-solid: var(--hl-solid-3); }
.comment-tip-row.hl-4, .comment-pin.hl-4, .comment-region.hl-4 { --hl: var(--hl-4); --hl-solid: var(--hl-solid-4); }
.comment-tip-row.hl-5, .comment-pin.hl-5, .comment-region.hl-5 { --hl: var(--hl-5); --hl-solid: var(--hl-solid-5); }
.comment-tip-row.hl-6, .comment-pin.hl-6, .comment-region.hl-6 { --hl: var(--hl-6); --hl-solid: var(--hl-solid-6); }
.comment-tip-row .dot, .comment .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--hl-solid); }
.comment-pin {
  width: 18px; height: 18px; min-height: 0; padding: 0; margin: -9px 0 0 -9px; border-radius: 50% 50% 50% 0;
  background: var(--hl-solid); border: 2px solid var(--canvas); box-shadow: var(--shadow-lg); cursor: pointer;
}
/* A meeting page's action-item boxes, drawn over the frame where each item's box is. */
.item-boxes .item-box {
  position: fixed; z-index: 11; min-height: 0; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 3px; color: var(--accent-fg);
}
.item-boxes .item-box:hover:not(:disabled) { border-color: var(--success); }
.item-boxes .item-box.checked { background: var(--success); border-color: var(--success); }
.item-boxes .item-box:disabled { cursor: default; }
.item-boxes .item-box svg { width: 100%; height: 100%; stroke-width: 3; }
.status { padding: 56px 16px; text-align: center; color: var(--muted); }
.status a { margin-left: 4px; }
/* A page its org's plan keeps closed: a card like the sign-in one. */
.status .plan-card {
  max-width: 420px; margin: 0 auto; padding: clamp(20px, 6vw, 28px); text-align: left; color: var(--fg);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.status .plan-card a { margin-left: 0; }
.plan-card h2 { margin: 0; font-size: var(--text-xl); }
.plan-card .back { margin-bottom: 0; }
.viewer #pw {
  margin: 56px auto; width: calc(100% - 32px); max-width: 380px; display: grid; gap: 10px; padding: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}

/* --- Page history ------------------------------------------------------- */

.bar .history-toggle { flex: none; }
.history-compare { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: var(--text-sm); }
.history-compare select { width: auto; height: 30px; min-height: 30px; padding: 2px 6px; font: var(--text-xs) var(--mono); box-shadow: none; }
.history-compare .btn { margin-left: auto; }
/* Touch screens: the viewer's own selects at 16px, so iPhone Safari doesn't
   zoom in when one is tapped, and its bar controls at 44px, as ui.css does
   for the rest. */
@media (pointer: coarse) {
  input:not([type="checkbox"], [type="radio"]), select { min-height: 44px; }
  /* ui-rules-allow: iPhone Safari's 16px zoom threshold, as in ui.css */
  .bar .versions, .history-compare select { font-size: 16px; }
  .bar button, .bar .versions, .history-compare select { min-height: 44px; }
  .bar .comment-tools .btn-icon { width: 44px; }
  .bar .history-toggle { min-width: 44px; }
}
@media (pointer: coarse) and (width <= 64em) {
  .bar .tier { width: 44px; height: 44px; }
}
.history-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.history-entry { display: grid; gap: 2px; padding: 10px 8px; border-bottom: 1px solid var(--border); border-radius: var(--radius-sm); }
.history-entry.kept { cursor: pointer; }
.history-entry.kept:hover, .history-entry.active { background: var(--surface-2); }
.history-entry:focus-visible { box-shadow: var(--ring); outline: 2px solid transparent; outline-offset: 2px; }
.history-entry:not(.kept) { color: var(--muted); }
.history-entry > header { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); }
.history-entry > header .when { margin-left: auto; font-size: var(--text-xs); color: var(--muted); }
.history-entry p { margin: 0; overflow-wrap: anywhere; }
.history-entry .subject { font-weight: 550; }
.history-entry .body { white-space: pre-wrap; font-size: var(--text-sm); color: var(--fg-2); max-height: 7.5em; overflow: hidden; }
.history-entry .by { font-size: var(--text-xs); color: var(--muted); }
.history-entry .locked { display: flex; align-items: center; gap: 4px; font-size: var(--text-sm); }
.history-entry .locked .icon { width: 13px; height: 13px; }
.history-entry .acts { display: flex; justify-content: flex-end; font-size: var(--text-xs); }
.history-entry .acts:has(> :only-child) { margin-top: 2px; }
.muted { color: var(--muted); }
.diff-summary { flex: 1; min-width: 12em; font-weight: 550; }
/* A comparison: the diff (diffView) in place of the page, scrolling inside
   itself so the page never scrolls sideways. */
.diff-pane { flex: 1; min-height: 0; overflow: auto; padding: 12px; background: var(--bg); }
.artifact.behind { display: none; }
/* An open side panel covers the page's right edge, so the notice and strips
   under the bar stop where it starts and their close buttons stay in reach. */
@media (width > 40em) {
  body:has(> .side-panel:not([hidden])) :is(.banner, .diff-pane) { margin-right: min(380px, 100%); }
}
