/* Team One Docs: the app's own design system. Every control here is styled (no browser-default select, input,
   button or dialog); new parts reuse these tokens and classes. Dark first; Light via the header switch
   (data-theme="light" on <html>), or the system when nothing was picked. */

:root {
  color-scheme: dark;
  --font: "Segoe UI Variable Text", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --display: "Segoe UI Variable Display", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 12px; --r-sm: 8px; --r-xs: 6px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* TeamOne's tool theme (the UE/Maya tools' teamone_theme.py TOKENS): neutral greys and the brand teal-green.
     --accent: text, icons, borders and focus. --accent-fill (with --accent-ink on it): filled controls. --rose: delete
     and errors only. */
  --bg: #141617; --surface: #1b1d1e; --surface-2: #202425; --sunk: #191b1c; --raise: #232627;
  --text: #e8eaea; --dim: #9ea5a5; --faint: #6e7576;
  --line: #2e3233; --line-strong: #363c3d; --line-hover: #4a5152;
  --hover: rgba(232, 234, 234, 0.05);
  --accent: #53c7b6; --accent-fill: #2e9e92; --accent-fill-hover: #35b5a7; --accent-fill-press: #27877d; --accent-ink: #08211e;
  --accent-soft: rgba(83, 199, 182, 0.13); --accent-edge: #346962; --selection: #1f3b38;
  --mint: #4fe0a6; --gold: #e0b34c; --rose: #e05c4e; --blue: #7fa6e0;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 16px 40px rgba(0, 0, 0, 0.45);
  --glow: radial-gradient(900px 380px at 15% -160px, rgba(83, 199, 182, 0.08), transparent 70%),
          radial-gradient(700px 320px at 90% -160px, rgba(127, 166, 224, 0.05), transparent 70%);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f6; --surface: #ffffff; --surface-2: #eff1f1; --sunk: #eaeded; --raise: #ffffff;
  --text: #161a1a; --dim: #566060; --faint: #8a9393;
  --line: rgba(20, 30, 30, 0.10); --line-strong: rgba(20, 30, 30, 0.20); --line-hover: rgba(20, 30, 30, 0.32);
  --hover: rgba(20, 30, 30, 0.045);
  --accent: #17766b; --accent-fill: #17766b; --accent-fill-hover: #13675d; --accent-fill-press: #0f5850; --accent-ink: #ffffff;
  --accent-soft: rgba(23, 118, 107, 0.10); --accent-edge: rgba(23, 118, 107, 0.45); --selection: rgba(23, 118, 107, 0.18);
  --mint: #0f8f5c; --gold: #8a5d00; --rose: #b83a2e; --blue: #1f6fc4;
  --shadow: 0 1px 2px rgba(20, 30, 30, 0.05), 0 12px 32px rgba(20, 30, 30, 0.08);
  --glow: radial-gradient(900px 380px at 15% -160px, rgba(23, 118, 107, 0.06), transparent 70%),
          radial-gradient(700px 320px at 90% -160px, rgba(31, 111, 196, 0.04), transparent 70%);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f5f6f6; --surface: #ffffff; --surface-2: #eff1f1; --sunk: #eaeded; --raise: #ffffff;
    --text: #161a1a; --dim: #566060; --faint: #8a9393;
    --line: rgba(20, 30, 30, 0.10); --line-strong: rgba(20, 30, 30, 0.20); --line-hover: rgba(20, 30, 30, 0.32);
    --hover: rgba(20, 30, 30, 0.045);
    --accent: #17766b; --accent-fill: #17766b; --accent-fill-hover: #13675d; --accent-fill-press: #0f5850; --accent-ink: #ffffff;
    --accent-soft: rgba(23, 118, 107, 0.10); --accent-edge: rgba(23, 118, 107, 0.45); --selection: rgba(23, 118, 107, 0.18);
    --mint: #0f8f5c; --gold: #8a5d00; --rose: #b83a2e; --blue: #1f6fc4;
    --shadow: 0 1px 2px rgba(20, 30, 30, 0.05), 0 12px 32px rgba(20, 30, 30, 0.08);
    --glow: radial-gradient(900px 380px at 15% -160px, rgba(23, 118, 107, 0.06), transparent 70%),
            radial-gradient(700px 320px at 90% -160px, rgba(31, 111, 196, 0.04), transparent 70%);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); scrollbar-color: var(--line-strong) transparent; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { margin: 0; background-image: var(--glow); background-repeat: no-repeat; }
::selection { background: var(--selection); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.01em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.faint { color: var(--faint); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font: 600 15px/1 var(--display); color: var(--text); }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(140deg, #2e9e92, #53c7b6); color: #08211e; font: 700 12px/1 var(--display); letter-spacing: -0.02em; }

/* ---------- buttons ---------- */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font: 500 13.5px/1 var(--font); cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s; white-space: nowrap; }
.btn:hover { background: var(--raise); border-color: var(--line-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--accent-fill); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-fill-hover); }
.btn.primary:active { background: var(--accent-fill-press); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--rose); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.block { width: 100%; height: 42px; font-size: 14.5px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- inputs ---------- */
.field { display: grid; gap: 6px; }
.field > label { font-size: 12.5px; color: var(--dim); font-weight: 500; }
.input { appearance: none; width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--sunk); color: var(--text); font: 14px/1 var(--font); transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--line-hover); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input.code { font: 600 22px/1 var(--mono); letter-spacing: 8px; text-align: center; height: 52px; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 34px; height: 36px; }

/* ---------- dropdown (never a native <select>) ---------- */
.dd { position: relative; display: inline-block; }
.dd-btn { appearance: none; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; max-width: 240px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: 500 13px/1 var(--font); cursor: pointer; }
.dd-btn:hover { background: var(--raise); }
.dd-btn .dd-label { color: var(--dim); font-weight: 400; }
.dd-btn .dd-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn svg { width: 14px; height: 14px; color: var(--faint); flex: none; transition: transform .15s var(--ease); }
.dd.open .dd-btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dd.open .dd-btn svg { transform: rotate(180deg); }
.dd-menu { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; min-width: 100%; max-width: 320px; max-height: 320px; overflow: auto;
  padding: 6px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--raise); box-shadow: var(--shadow);
  animation: pop .14s var(--ease); }
.dd-menu.right { left: auto; right: 0; }
.dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-xs); background: none;
  color: var(--text); font: 13.5px/1.3 var(--font); text-align: left; cursor: pointer; white-space: nowrap; }
.dd-item:hover, .dd-item.active { background: var(--hover); }
.dd-item > svg { width: 14px; height: 14px; color: var(--accent); flex: none; visibility: hidden; }
.dd-item[aria-selected="true"] > svg { visibility: visible; }
.dd-item .meta { margin-left: auto; padding-left: 16px; color: var(--faint); font-size: 12px; }
.dd-sep { height: 1px; margin: 6px 4px; background: var(--line); }
.dd-empty { padding: 10px; color: var(--faint); font-size: 13px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ---------- chips, cards ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--dim); font-size: 12px; white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* ---------- empty states, notes ---------- */
.empty { display: grid; justify-items: center; gap: 10px; padding: 64px 24px; text-align: center; color: var(--dim); }
.empty .art { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--faint); }
.empty .art svg { width: 26px; height: 26px; }
.empty h3 { color: var(--text); font-size: 16px; font-weight: 600; }
.empty p { margin: 0; max-width: 420px; }
.empty code, .note code { font: 12.5px var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; color: var(--text); }
.note { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.note.err { background: color-mix(in srgb, var(--rose) 10%, transparent); border-color: color-mix(in srgb, var(--rose) 32%, transparent); color: var(--rose); }

/* ---------- dialog ---------- */
.scrim { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(5, 6, 10, 0.6); backdrop-filter: blur(4px); animation: fade .15s; }
:root[data-theme="light"] .scrim { background: rgba(30, 32, 44, 0.25); }
.dialog { width: min(440px, 100%); padding: 22px; display: grid; gap: 14px; animation: pop .16s var(--ease); }
.dialog h3 { font-size: 17px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
@keyframes fade { from { opacity: 0; } }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 200; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 10px 14px; border-radius: var(--r-sm); background: var(--raise); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-size: 13.5px; animation: pop .16s var(--ease); pointer-events: auto; }
.toast.err { border-color: color-mix(in srgb, var(--rose) 45%, transparent); color: var(--rose); }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.signin-card { width: min(400px, 100%); padding: 32px 28px 28px; display: grid; gap: 18px; }
.signin-card h1 { font-size: 22px; font-weight: 650; }
.signin-card .lede { margin: -8px 0 0; color: var(--dim); }
.signin-card form { display: grid; gap: 14px; }
.signin-foot { text-align: center; font-size: 12.5px; color: var(--faint); }
.linklike { appearance: none; border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }

/* ---------- app shell ---------- */
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 20px;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); }
.top .grow { flex: 1; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
  font: 600 12px/1 var(--display); text-transform: uppercase; border: 1px solid var(--line); cursor: pointer; }
.main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }

/* ---------- list ---------- */
.list-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.list-head h1 { font-size: 26px; font-weight: 650; }
.list-head .count { display: block; margin-top: 4px; color: var(--faint); font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.filters .search { flex: 1 1 260px; max-width: 420px; }
.rows { display: grid; gap: 8px; }
.row { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: border-color .15s, background .15s, transform .15s var(--ease); }
.row:hover { text-decoration: none; border-color: var(--line-strong); background: var(--surface-2); }
.row:active { transform: translateY(1px); }
.row-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.row-icon svg { width: 19px; height: 19px; }
.row-main { min-width: 0; }
.row-title { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; color: var(--faint); font-size: 12.5px; min-width: 0; }
.row-sub .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; align-items: center; gap: 14px; color: var(--dim); font-size: 12.5px; white-space: nowrap; }
.row-when { min-width: 72px; text-align: right; }
.row-icon.archived { background: var(--surface-2); color: var(--faint); }
.archived-row .row-title { color: var(--dim); }
.archived-row .row-act { margin: 0; }
.archived-row .row-sub { flex-wrap: wrap; column-gap: 12px; row-gap: 2px; }
.archived-row .row-where { flex: none; max-width: 100%; }
.btn-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--surface-2); color: var(--dim); font: 600 11px/1 var(--display); }
.btn[aria-pressed="true"] .btn-count { background: var(--accent-fill); color: var(--accent-ink); }
.btn-count:empty { display: none; }
.chip.shared svg { width: 13px; height: 13px; }
.share-add { display: flex; gap: 8px; }
.share-add .input { flex: 1; min-width: 0; }
.share-note { margin: 0; color: var(--faint); font-size: 12.5px; }
.row.skeleton { pointer-events: none; grid-template-columns: 40px 1fr; }
/* the whole row is its link (stretched over it); the menu and people sit above it */
.row-hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.row-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row-act { position: relative; z-index: 2; margin: -4px -8px -4px -6px; }
/* a row with its menu open sits above the rows after it, so the menu takes the clicks (not the next row's link) */
.row:has(.dd.open) { z-index: 3; }
/* who took part: bubbles where the author's name was, above the row's link */
.row-people { position: relative; z-index: 2; display: flex; align-items: center; margin: -4px 0; }
.row-people .avatar { width: 28px; height: 28px; font-size: 11px; }
.row-people > .avatar.who { border: 2px solid var(--surface); cursor: default; }
.row-people .people-btn .avatar { margin-left: -8px; border-color: var(--surface); }
.row-people .people-btn .avatar:first-child { margin-left: 0; }
.row:hover .row-people .avatar { border-color: var(--surface-2); }
@media (min-width: 641px) { .row-meta .row-people { min-width: 88px; justify-content: flex-end; } }
.row-icon.folder { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.row-where { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--dim); }
.row-where svg { width: 13px; height: 13px; flex: none; color: var(--faint); }
.row-where span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-owner { flex: none; color: var(--faint); white-space: nowrap; }

/* crumbs: where you are in the folders */
.crumbs { display: flex; align-items: center; gap: 4px; min-height: 36px; margin: -4px 0 12px; font-size: 13.5px; color: var(--dim); min-width: 0; }
.crumbs > svg { width: 14px; height: 14px; color: var(--faint); flex: none; }
.crumbs .grow { flex: 1; }
.crumb { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--r-xs); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.crumb svg { width: 14px; height: 14px; flex: none; }
.crumb span { overflow: hidden; text-overflow: ellipsis; }
.crumb { flex: 0 1 auto; min-width: 0; }
a.crumb:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.crumb.here { color: var(--text); font-weight: 600; }

/* switch (role="switch") */
.switch { appearance: none; display: inline-flex; align-items: center; gap: 9px; height: 30px; padding: 0 4px; border: 0; background: none; color: var(--dim);
  font: 500 13px var(--font); cursor: pointer; border-radius: var(--r-xs); }
.switch:hover { color: var(--text); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-track { position: relative; width: 32px; height: 18px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); transition: background .15s, border-color .15s; flex: none; }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--dim); transition: transform .18s var(--ease), background .15s; }
.switch[aria-checked="true"] .switch-track { background: var(--accent-fill); border-color: transparent; }
.switch[aria-checked="true"] .switch-knob { transform: translateX(14px); background: var(--accent-ink); }

/* action menus (⋯) use the dropdown's menu */
.menu-dd .dd-menu { min-width: 190px; }
.dd-menu.up { top: auto; bottom: calc(100% + 6px); }
.actions-menu .dd-item > svg { visibility: visible; color: var(--faint); }
.actions-menu .dd-item.danger, .actions-menu .dd-item.danger > svg { color: var(--rose); }
.dd-item:disabled { opacity: .45; cursor: default; }
.dd-item:disabled:hover { background: none; }
.menu-dd.open > .btn { background: var(--hover); color: var(--text); }

/* dialogs with a form; the folder tree picker */
.dialog.wide { width: min(520px, 100%); }
.dialog form { display: grid; gap: 14px; }
.dialog .lede { margin: -8px 0 0; font-size: 13px; }
/* "How to make an artifact": a joined pair (copy | read) and its reading dialog */
.btn-split { display: inline-flex; }
.btn-split > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split > .btn + .btn { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.btn-split > .btn:hover, .btn-split > .btn:focus-visible { position: relative; z-index: 1; }
.dialog.wide:has(.howto) { width: min(960px, 100%); }
.howto { display: grid; gap: 14px; min-width: 0; }
.howto-text { margin: 0; max-height: min(56vh, 520px); overflow: auto; padding: 14px 16px; border-radius: var(--r-sm); background: var(--sunk);
  border: 1px solid var(--line); color: var(--text); font: 12.5px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.btn.danger-fill { background: var(--rose); color: #fff; }
.btn.danger-fill:hover { background: color-mix(in srgb, var(--rose) 85%, #000); }
.tree { display: grid; gap: 2px; max-height: min(360px, 55vh); overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk); }
.tree-item { appearance: none; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 6px 10px 6px calc(10px + var(--depth, 0) * 18px);
  border: 0; border-radius: var(--r-xs); background: none; color: var(--text); font: 13.5px var(--font); text-align: left; cursor: pointer; }
.tree-item svg { width: 15px; height: 15px; flex: none; color: var(--faint); }
.tree-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item .meta { margin-left: auto; padding-left: 12px; font-size: 12px; color: var(--faint); flex: none; }
.tree-item:hover { background: var(--hover); }
.tree-item[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.tree-item[aria-selected="true"] svg { color: var(--accent); }
.tree-item:disabled { opacity: .4; cursor: default; background: none; }
.row.skeleton .row-icon { background: var(--surface-2); }
.bar { height: 11px; width: 42%; border-radius: 6px; background: var(--surface-2); animation: shimmer 1.2s ease-in-out infinite alternate; }
.bar.short { width: 22%; margin-top: 8px; }
@keyframes shimmer { to { opacity: .45; } }

/* ---------- viewer ---------- */
.main-full { height: calc(100vh - 56px); height: calc(100dvh - 56px); }
.viewer { height: 100%; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }
.viewer-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.viewer-title { flex: 1; min-width: 0; }
.page-title { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-sub { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 12.5px; min-width: 0; white-space: nowrap; overflow: hidden; }
.page-sub .dim { overflow: hidden; text-overflow: ellipsis; }
.viewer-actions { display: flex; align-items: center; gap: 8px; }
.viewer-actions .dd-btn { height: 30px; font-size: 12.5px; }
.btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.count-badge:not(:empty) { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-fill); color: var(--accent-ink); font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; }
.viewer-body { position: relative; display: grid; grid-template-columns: 1fr; min-height: 0; }
.viewer.with-panel .viewer-body { grid-template-columns: 1fr 360px; }
.stage { position: relative; min-height: 0; background: var(--sunk); }
.page-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; opacity: 0; transition: opacity .2s; }
.stage.loaded .page-frame { opacity: 1; }
.stage-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.stage.loaded .stage-loading { display: none; }
.stage.picking { box-shadow: inset 0 0 0 2px var(--accent); }
.stage.picking::after { content: "Click anything in the page to comment on it"; position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  padding: 7px 12px; border-radius: 999px; background: var(--accent-fill); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; pointer-events: none; box-shadow: var(--shadow); white-space: nowrap; }
.stage > .empty { position: absolute; inset: 0; align-content: center; }

.panel { display: none; min-height: 0; grid-template-rows: auto 1fr auto; border-left: 1px solid var(--line); background: var(--surface); }
.viewer.with-panel .panel { display: grid; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 14px; font-weight: 600; }
.comments { overflow: auto; padding: 8px 12px; display: grid; align-content: start; gap: 4px; }
.comment { padding: 10px 6px; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.comment-head b { font-weight: 600; }
.comment-del { margin-left: auto; opacity: 0; }
.comment:hover .comment-del, .comment-del:focus-visible { opacity: 1; }
.comment-quote { display: flex; gap: 6px; align-items: flex-start; margin: 8px 0 0; padding: 6px 8px; border-left: 2px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; color: var(--dim); font-size: 12.5px; }
.comment-quote svg { width: 13px; height: 13px; flex: none; margin-top: 2px; color: var(--accent); }
.comment-text { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; cursor: default; }
.composer { display: grid; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.composer textarea { min-height: 72px; }
.composer-row { display: flex; align-items: center; gap: 8px; }
.composer-row .grow { flex: 1; }
.btn.on { background: var(--accent-soft); color: var(--accent); }
.pick-chip { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); font-size: 12.5px; }
.pick-chip span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-chip > svg { width: 14px; height: 14px; flex: none; }
.empty.small { padding: 40px 12px; }
.empty.small .art { width: 44px; height: 44px; border-radius: 12px; }
.empty.small .art svg { width: 20px; height: 20px; }
.empty.small h3 { font-size: 14px; }
.empty.small p { font-size: 13px; }

@media (max-width: 900px) {
  .viewer.with-panel .viewer-body { grid-template-columns: 1fr; }
  .viewer.with-panel .panel { position: absolute; inset: auto 0 0 0; height: min(70%, 560px); border-left: 0; border-top: 1px solid var(--line-strong);
    border-radius: 16px 16px 0 0; box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.35); z-index: 5; animation: sheet .2s var(--ease); }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }

@media (max-width: 640px) {
  .top { padding: 0 12px; gap: 8px; }
  .main { padding: 18px 12px 48px; }
  .signin-card { padding: 26px 20px 22px; }
  .hide-sm { display: none; }
  .row { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 12px; column-gap: 12px; row-gap: 6px; }
  .row-act { grid-column: 3; grid-row: 1; }
  .crumb { max-width: 140px; }
  .list-tools .btn span { display: none; }
  .list-tools .btn { width: 30px; padding: 0; }
  .list-tools .btn.archived-btn { width: auto; min-width: 30px; padding: 0 7px; gap: 5px; }
  .restore-btn span { display: none; }
  .restore-btn { width: 30px; padding: 0; }
  .row-icon { width: 36px; height: 36px; }
  .row-meta { grid-column: 2 / 4; gap: 10px; min-width: 0; }
  .row-when { min-width: 0; text-align: left; }
  .filters .search { flex-basis: 100%; max-width: none; }
  .viewer-bar { padding: 8px 10px; gap: 8px; }
  .viewer-actions { gap: 6px; }
  .page-sub .dim { display: none; }
  /* the title (and who has it checked out) gets its own row; the buttons go under it */
  .viewer-bar:not(.compare .viewer-bar) { flex-wrap: wrap; row-gap: 6px; }
  .viewer-bar:not(.compare .viewer-bar) .viewer-title { flex: 1 1 calc(100% - 48px); }
  .viewer-bar:not(.compare .viewer-bar) .viewer-actions { flex: 1 1 100%; justify-content: flex-end; }
}

/* ===== viewer extras (Helper B: web/view.js only; keep viewer-only rules in this block) ===== */
.stage.loaded .page-frame.leaving { opacity: 0; pointer-events: none; }
.live-note { position: absolute; z-index: 4; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  max-width: calc(100% - 24px); padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); color: var(--dim); font-size: 12.5px; white-space: nowrap; animation: pop .16s var(--ease); transition: opacity .2s; }
.live-note b { color: var(--text); font-weight: 600; }
.live-note > svg { width: 14px; height: 14px; color: var(--accent); flex: none; }
.live-note > span { overflow: hidden; text-overflow: ellipsis; }
.live-note.out { opacity: 0; }
.comment .avatar.who { background: var(--who); color: #fff; border-color: transparent; }
.comment.flash { animation: who-flash 1.2s var(--ease); }
@keyframes who-flash { from { background: color-mix(in srgb, var(--who) 18%, transparent); } }
.comment { border-radius: var(--r-sm); }
.comment .comment-quote { border-left-color: var(--who); background: color-mix(in srgb, var(--who) 12%, transparent); }
.comment .comment-quote svg { color: var(--who); }
button.comment-quote { appearance: none; width: 100%; border: 0; border-left: 2px solid var(--who); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; align-items: center; }
button.comment-quote:hover { background: color-mix(in srgb, var(--who) 20%, transparent); color: var(--text); }
button.comment-quote > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pin-n { flex: none; width: 18px; height: 18px; border-radius: 50% 50% 50% 3px; background: var(--who); color: #fff; font: 700 10px/18px var(--font); text-align: center; }
.people { position: relative; display: flex; }
.people-slot { display: contents; }
.people-btn { appearance: none; display: flex; align-items: center; padding: 2px 4px; border: 0; border-radius: 999px; background: none; cursor: pointer; }
.people-btn:hover, .people.open .people-btn { background: var(--hover); }
.people-btn .avatar { width: 28px; height: 28px; font-size: 11px; margin-left: -8px; border: 2px solid var(--surface); cursor: pointer; }
.people-btn .avatar:first-child { margin-left: 0; }
.avatar.who { background: var(--who); color: #fff; border-color: transparent; }
.people-btn .avatar.who { border-color: var(--surface); }
.avatar.more { background: var(--surface-2); color: var(--dim); border: 2px solid var(--surface); text-transform: none; }
.people-menu { width: 300px; max-width: calc(100vw - 24px); max-height: 360px; }
.people-menu-head { padding: 6px 10px 8px; color: var(--faint); font-size: 12px; }
.person { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-xs); }
.person:hover { background: var(--hover); }
.person .avatar { width: 30px; height: 30px; font-size: 11.5px; flex: none; cursor: default; }
.person-main { display: grid; min-width: 0; flex: 1; font-size: 13px; line-height: 1.3; }
.person-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-main .faint { font-size: 11.5px; }
.person-roles { color: var(--dim); font-size: 11.5px; white-space: nowrap; }
@media (max-width: 640px) {
  .page-sub .people-btn { padding: 0; margin: 1px 0 0 -2px; }
  .page-sub .people-btn .avatar { width: 22px; height: 22px; font-size: 9.5px; margin-left: -6px; }
  .page-sub .people-btn .avatar:first-child { margin-left: 0; }
}
/* the app's tooltip (ui.js, any [data-tip]): a person's name on their bubble */
.tip { position: fixed; z-index: 90; max-width: min(280px, calc(100vw - 16px)); padding: 5px 9px; border-radius: var(--r-xs); pointer-events: none;
  background: var(--raise); border: 1px solid var(--line-strong); box-shadow: var(--shadow); color: var(--text);
  font: 500 12.5px/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: tip .12s var(--ease); }
.tip.below { animation-name: tip-below; }
@keyframes tip { from { opacity: 0; transform: translateY(3px); } }
@keyframes tip-below { from { opacity: 0; transform: translateY(-3px); } }
/* the account menu: your own bubble, and your name atop the menu */
.face-btn { appearance: none; display: grid; place-items: center; padding: 2px; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.face-btn:hover .avatar, .dd.open .face-btn .avatar { box-shadow: 0 0 0 3px color-mix(in srgb, var(--who) 30%, transparent); }
.avatar.me { width: 34px; height: 34px; font-size: 12.5px; border: 0; transition: box-shadow .15s var(--ease); }
.menu-me { display: flex; align-items: center; gap: 10px; padding: 8px 10px 4px; min-width: 240px; max-width: 300px; }
.menu-me .avatar { width: 36px; height: 36px; font-size: 13px; flex: none; cursor: default; }
.menu-me .person-main b { font-weight: 600; }
/* ===== end viewer extras ===== */

/* ===== keys (Helper C: web/keys.js only) ===== */
.keys { max-width: 880px; }
.keys-intro { margin: 0 0 18px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--dim); font-size: 13.5px; }
.keys-intro p { margin: 0 0 8px; color: var(--text); }
.keys-intro ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.keys-intro code, .key-once code:not(.key-secret) { font: 12.5px var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; color: var(--text); overflow-wrap: anywhere; }
.key-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
.key-row:hover { border-color: var(--line); background: var(--surface); }
.key-row:active { transform: none; }
.key-row .row-sub { flex-wrap: wrap; column-gap: 14px; row-gap: 2px; }
.key-row .key-prefix { color: var(--dim); }
.key-row.expired .row-icon { background: var(--surface-2); color: var(--faint); }
.key-row.expired .row-title { color: var(--dim); }
.key-row .tag-bad { color: var(--rose); }
.key-once { display: grid; gap: 12px; }
.key-secret-line { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: var(--r-sm); background: var(--sunk); border: 1px solid var(--line-strong); }
.key-secret { flex: 1; min-width: 0; font: 600 13px/1.45 var(--mono); color: var(--text); word-break: break-all; user-select: all; }
.key-secret:focus-visible { outline-offset: 4px; }
.note.warn { background: color-mix(in srgb, var(--gold) 10%, transparent); border-color: color-mix(in srgb, var(--gold) 32%, transparent); color: var(--text); }
.note.warn code { font: 12px var(--mono); }
.key-next { margin: 0; font-size: 12.5px; }
@media (max-width: 640px) {
  .key-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .key-row .row-sub { column-gap: 10px; }
  .key-revoke span { display: none; }
  .key-revoke { width: 30px; padding: 0; }
  .keys .list-tools .btn span { display: inline; }
  .keys .list-tools .btn { width: auto; padding: 0 10px; }
}

/* ===== sharing: the side panel (ui.sidePanel), the share panel (web/share.js), list tabs ===== */
/* the side panel: Fleet View's detail panel. It slides in from the right edge under the top bar; on a wide screen the
   page beside it gives up that room, on a narrower one it lies over the page, on a phone it fills the screen */
.side { position: fixed; top: 56px; right: 0; bottom: 0; z-index: 45; width: 400px; max-width: 100%; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line); transform: translateX(100%); visibility: hidden;
  transition: transform .2s var(--ease), visibility 0s linear .2s; }
.side.open { transform: none; visibility: visible; transition: transform .2s var(--ease), visibility 0s; }
.main, .main-full { transition: margin-right .2s var(--ease); }
@media (min-width: 1101px) { body.side-open .main, body.side-open .main-full { margin-right: 400px; } }
@media (max-width: 1100px) { .side { box-shadow: -14px 0 40px rgba(0, 0, 0, 0.35); } }
:root[data-theme="light"] .side { box-shadow: none; }
@media (max-width: 1100px) { :root[data-theme="light"] .side { box-shadow: -14px 0 40px rgba(20, 30, 30, 0.12); } }
@media (prefers-reduced-motion: reduce) { .side, .side.open, .main, .main-full { transition: none; } }
.side-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 12px 12px 18px; border-bottom: 1px solid var(--line); flex: none; }
.side-titles { flex: 1; min-width: 0; }
.side-head h2 { font-size: 15px; font-weight: 600; }
.side-sub { margin-top: 2px; color: var(--dim); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 24px; }

/* the share panel */
.share { display: grid; gap: 22px; }
.share-loading { display: grid; place-items: center; padding: 40px; color: var(--faint); }
.share-sec { display: grid; gap: 8px; min-width: 0; }
.share-h { font: 600 12.5px/1.2 var(--font); color: var(--dim); letter-spacing: 0; }
.share-h .faint { font-weight: 400; }
.share-add { display: flex; gap: 8px; }
.share-add .input { flex: 1; min-width: 0; }
.share-add .dd-btn { height: 40px; }
.suggest { display: grid; gap: 1px; padding: 6px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--raise); box-shadow: var(--shadow);
  max-height: 300px; overflow-y: auto; animation: pop .14s var(--ease); }
.suggest-head, .suggest-empty { padding: 6px 8px 4px; color: var(--faint); font-size: 12px; }
.suggest-empty { padding: 8px; }
.suggest-item { appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: var(--r-xs);
  background: none; color: var(--text); font: 13px/1.3 var(--font); text-align: left; cursor: pointer; }
.suggest-item[aria-selected="true"] { background: var(--hover); }
.suggest-item .avatar { width: 30px; height: 30px; font-size: 11.5px; flex: none; cursor: inherit; }
.suggest-item .person-main b { font-weight: 600; }
.suggest-meta { flex: none; color: var(--faint); font-size: 11.5px; }
.share-people { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.share-person { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 0; }
.share-person > .avatar { width: 32px; height: 32px; font-size: 12px; flex: none; cursor: default; }
.share-person .person-main b { font-weight: 600; }
.share-person .you { color: var(--faint); font-weight: 400; }
.share-role { flex: none; color: var(--dim); font-size: 12.5px; padding: 0 4px; }
.share-role-dd .dd-btn, .general .dd-btn { height: 30px; font-size: 12.5px; border-color: transparent; background: transparent; padding: 0 6px 0 8px; }
.share-role-dd .dd-btn:hover, .general .dd-btn:hover { background: var(--hover); border-color: var(--line); }
.dd-menu .dd-item.danger, .dd-menu .dd-item.danger > svg { color: var(--rose); }
.dd-item .dd-icon { display: inline-grid; flex: none; color: var(--dim); }
.dd-item .dd-icon svg { width: 15px; height: 15px; }
.general { display: flex; align-items: flex-start; gap: 10px; }
.general-badge { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--dim); }
.general-badge.team, .general-badge.link { background: var(--accent-soft); color: var(--accent); }
.general-badge svg { width: 16px; height: 16px; }
.general-main { flex: 1; min-width: 0; display: grid; justify-items: start; gap: 2px; }
.general-main > .dd { margin-left: -8px; }
.general-main > b { font-weight: 600; font-size: 13.5px; line-height: 30px; }
.general-desc { margin: 0; color: var(--faint); font-size: 12px; }
.general > .dd, .general > .share-role { margin-top: 0; flex: none; }
.share-foot { display: grid; gap: 10px; justify-items: start; padding-top: 14px; border-top: 1px solid var(--line); }
.share-foot .share-note { margin: 0; }
.share-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* list: privacy chips and the tabs */
.chip.private svg, .chip.shared svg, .chip.public svg { width: 13px; height: 13px; }
.chip.public { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--sunk); border: 1px solid var(--line); }
.seg-btn { appearance: none; height: 28px; padding: 0 12px; border: 0; border-radius: var(--r-xs); background: none; color: var(--dim); font: 500 13px/1 var(--font);
  cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
:root[data-theme="light"] .seg-btn[aria-selected="true"] { box-shadow: 0 1px 2px rgba(20, 30, 30, 0.12); }
.list-tabs { margin: -4px 0 14px; max-width: 100%; overflow-x: auto; }
@media (max-width: 640px) {
  .side { width: 100%; border-left: 0; }
  .side-body { padding: 14px 14px 24px; }
  .seg { display: flex; width: 100%; }
  .seg-btn { flex: 1; padding: 0 6px; font-size: 12.5px; }
}
/* ===== end sharing ===== */
.composer-note { color: var(--faint); font-size: 12.5px; }

/* history (web/history.js): one entry per version, newest first, in the side panel */
.hist-list { display: grid; gap: 10px; }
.hist { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); display: grid; gap: 8px; }
.hist.on { border-color: var(--accent-edge); background: var(--accent-soft); }
.hist-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hist-head .chip svg { width: 12px; height: 12px; }
.hist-v { font: 600 14px var(--display); margin-right: 2px; }
.hist-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; }
.hist-desc { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.5; }
.hist-desc.none { color: var(--faint); font-style: italic; }
.hist-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* compare (web/compare.js): two versions side by side, or the changes file by file. Restore's description hint. */
.field-hint { font-size: 12px; color: var(--faint); }
.cmp-actions { flex-wrap: wrap; justify-content: flex-end; }
.cmp-picks { display: flex; align-items: center; gap: 4px; }
.cmp-modes { display: flex; align-items: center; gap: 12px; }
.cmp-modes .switch[hidden] { display: none; }
.cmp-body { position: relative; min-height: 0; display: grid; }
.cmp-sides { min-height: 0; display: grid; grid-template-columns: 1fr 1fr; }
.cmp-pane { min-height: 0; display: grid; grid-template-rows: auto 1fr; }
.cmp-pane + .cmp-pane { border-left: 1px solid var(--line-strong); }
.cmp-label { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 12.5px; white-space: nowrap; }
.cmp-label .cmp-desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--dim); }
.cmp-label .cmp-desc::before { content: "·"; margin-right: 8px; color: var(--faint); }
.compare[data-mode="changes"] .cmp-sides { display: none; }
.compare:not([data-mode="changes"]) .cmp-changes { display: none; }
.cmp-changes { min-height: 0; overflow: auto; padding: 18px 20px 48px; display: grid; align-content: start; gap: 12px; }
.cmp-changes > * { width: 100%; max-width: 1100px; margin: 0 auto; }
.cmp-wait { position: static; padding: 48px; }
.cmp-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cmp-summary b { font: 600 15px var(--display); margin-right: 4px; }
.chip.chg { color: var(--gold); }
.chip.del { color: var(--rose); }
.cmp-file { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.cmp-file-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; }
.cmp-path { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.cmp-counts { display: inline-flex; gap: 6px; font: 600 12px var(--mono); }
.cmp-counts .plus { color: var(--mint); }
.cmp-counts .minus { color: var(--rose); }
.cmp-size { font-size: 12px; }
.cmp-note { margin: 0; padding: 0 14px 12px; color: var(--dim); font-size: 13px; }
.cmp-lines { border-top: 1px solid var(--line); overflow-x: auto; font: 12.5px/1.55 var(--mono); background: var(--sunk); }
.dl { display: grid; grid-template-columns: 44px 44px minmax(0, 1fr); min-width: max-content; }
.dl .ln { padding: 0 8px; text-align: right; color: var(--faint); user-select: none; border-right: 1px solid var(--line); }
.dl .tx { padding: 0 12px 0 6px; white-space: pre; }
.dl .op { display: inline-block; width: 14px; color: var(--faint); user-select: none; }
.dl.add { background: color-mix(in srgb, var(--mint) 12%, transparent); }
.dl.add .op { color: var(--mint); }
.dl.del { background: color-mix(in srgb, var(--rose) 12%, transparent); }
.dl.del .op { color: var(--rose); }
.dl.hunk { color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); }
.dl.hunk .tx { padding-left: 20px; }
@media (max-width: 640px) {
  .compare .viewer-bar { flex-wrap: wrap; }
  .cmp-actions { width: 100%; justify-content: space-between; }
  .cmp-modes { flex: 1; justify-content: flex-end; }
  .cmp-modes .seg { width: auto; }
  .cmp-sides { grid-template-columns: 1fr; }
  .compare[data-mode="a"] .cmp-b, .compare[data-mode="b"] .cmp-a { display: none; }
  .cmp-pane + .cmp-pane { border-left: 0; }
  .cmp-label .cmp-when { display: none; }
  .cmp-changes { padding: 12px 10px 40px; }
  .dl { grid-template-columns: 34px 34px minmax(0, 1fr); }
}

/* checkout (P4V's "checked out by"): the viewer's line under the title, and a tag on list rows */
.chip.co { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); border-color: color-mix(in srgb, var(--gold) 30%, transparent); max-width: 100%; }
.chip.co svg { width: 13px; height: 13px; flex: none; }
.chip.co span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.co .co-since { opacity: .8; }
.page-sub .chip.co { flex: 0 1 auto; min-width: 0; }
