@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700;800&display=swap');

:root, [data-theme="dark"] {
  --bg: #0b0d10;
  --bg-2: #0f1216;
  --panel: #14181d;
  --panel-2: #1a1f26;
  --panel-3: #222833;
  --line: #242a33;
  --line-2: #323a46;
  --text: #e9ebee;
  --muted: #8b94a1;
  --faint: #5d6672;
  --accent: #b6f24a;
  --accent-ink: #0b0d10;
  --accent-text: #b6f24a;
  --accent-soft: rgba(182, 242, 74, .12);
  --link: #8cc4ff;
  --danger: #ff5c6c;
  --danger-soft: rgba(255, 92, 108, .12);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, .12);
  --add: rgba(70, 200, 120, .16);
  --del: rgba(255, 92, 108, .16);
  --sel: rgba(255, 214, 102, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .25);
  --code-bg: #0d1014;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f5f6f8;
  --bg-2: #eceef2;
  --panel: #ffffff;
  --panel-2: #f3f5f8;
  --panel-3: #e9ecf1;
  --line: #e2e5ea;
  --line-2: #cfd4dc;
  --text: #15181d;
  --muted: #5e6774;
  --faint: #8d95a1;
  --accent: #a3e635;
  --accent-ink: #11160a;
  --accent-text: #4d7c0f;
  --accent-soft: rgba(132, 204, 22, .14);
  --link: #1f6fd1;
  --danger: #d92d3f;
  --danger-soft: rgba(217, 45, 63, .08);
  --warn: #b26a00;
  --warn-soft: rgba(178, 106, 0, .09);
  --add: rgba(40, 167, 69, .14);
  --del: rgba(217, 45, 63, .12);
  --sel: rgba(255, 200, 0, .2);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .06);
  --code-bg: #fbfcfd;
  color-scheme: light;
}

:root {
  --radius: 12px;
  --radius-sm: 8px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
body.ready { transition: background-color .2s, color .2s; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
::selection { background: var(--accent-soft); }

.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1160px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 20px; position: relative; }
.logo { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: -.5px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 13px; letter-spacing: -.5px; }
.nav { display: flex; gap: 4px; align-items: center; margin-left: 18px; }
.nav a { color: var(--muted); padding: 7px 11px; border-radius: 8px; font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--panel-2); text-decoration: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.theme-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.theme-btn:hover { color: var(--text); border-color: var(--line-2); }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 14px; font-weight: 500; }
.me-chip:hover { text-decoration: none; border-color: var(--line-2); }
.menu-btn { display: none; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 9px; width: 36px; height: 36px; cursor: pointer; }
.staff-pill { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .5px; }
@media (max-width: 760px) {
  .menu-btn { display: grid; place-items: center; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0; background: var(--panel); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 8px 16px 14px; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .me-chip span.name { display: none; }
}

/* layout */
main { width: 100%; max-width: 1160px; margin: 0 auto; padding: 32px 20px 80px; flex: 1; }
main.narrow { max-width: 860px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.6px; font-weight: 750; font-family: var(--head, var(--sans)); }
h2 { font-size: 17px; margin: 0 0 14px; letter-spacing: -.2px; font-family: var(--head, var(--sans)); }
.sub { color: var(--muted); margin: 0 0 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }
.banner { display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--text); padding: 11px 14px; border-radius: var(--radius); margin-bottom: 20px; }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.banner.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.banner .ic { margin-top: 2px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }

/* forms */
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 12px; font: inherit; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
[data-theme="light"] input[type=text], [data-theme="light"] input[type=email], [data-theme="light"] input[type=password],
[data-theme="light"] input[type=number], [data-theme="light"] input[type=search], [data-theme="light"] select, [data-theme="light"] textarea { background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { font-family: var(--mono); font-size: 13.5px; line-height: 1.6; min-height: 320px; resize: vertical; tab-size: 2; display: block; }
.field { margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.prefix-input { display: flex; align-items: stretch; }
.prefix-input span { background: var(--panel-2); border: 1px solid var(--line); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 9px 10px; color: var(--muted); font-family: var(--mono); font-size: 12.5px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.prefix-input input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-family: var(--mono); min-width: 0; }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; border: 0; color: var(--muted); padding: 6px 13px; border-radius: 7px; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line-2), 0 1px 2px rgba(0, 0, 0, .15); }
.seg.full { display: flex; }
.seg.full button { flex: 1; justify-content: center; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text); margin: 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 99px; background: var(--panel-3); border: 1px solid var(--line-2);
  position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(16px); background: var(--accent-ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 14px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: border-color .15s, background .15s, transform .05s; }
.btn:hover { border-color: var(--line-2); background: var(--panel-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.05); background: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.icon { padding: 7px; }
.btn.small.icon { padding: 5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.on { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); }
.btn.on .ic { fill: currentColor; }
.btn .count { font-variant-numeric: tabular-nums; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; color: var(--muted); }

.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); padding: 30px 16px; text-align: center; color: var(--muted); cursor: pointer;
  transition: border-color .15s, background .15s; background: var(--bg-2); }
.dropzone.drag, .dropzone:hover { border-color: var(--accent-text); color: var(--text); background: var(--accent-soft); }
.dropzone strong { color: var(--text); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 10.5px; font-weight: 500; padding: 2px 7px; border-radius: 99px;
  border: 1px solid var(--line-2); color: var(--muted); text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; line-height: 1.4; }
.badge .ic { width: 11px; height: 11px; vertical-align: 0; }
.badge.pin { border-color: color-mix(in srgb, var(--accent-text) 50%, transparent); color: var(--accent-text); }
.badge.private, .badge.lock { border-color: color-mix(in srgb, var(--warn) 50%, transparent); color: var(--warn); }
.badge.public { border-color: color-mix(in srgb, var(--link) 45%, transparent); color: var(--link); }
.badge.burn { border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger); }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; text-transform: uppercase; font-family: var(--sans); }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 14px; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 7px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent-text); }

/* home grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid .empty { grid-column: 1 / -1; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tile { aspect-ratio: 5 / 3; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius); color: var(--text); overflow: hidden; min-width: 0; box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; }
.tile:hover { border-color: var(--accent-text); text-decoration: none; transform: translateY(-2px); }
.tile-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tile-title { font-weight: 650; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; letter-spacing: -.2px; }
.tile .snip { flex: 1; min-height: 0; margin: 0; overflow: hidden; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--muted); white-space: pre-wrap; word-break: break-word;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
  -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.tile .thumb { flex: 1; min-height: 0; border-radius: var(--radius-sm); background: var(--code-bg) center / cover no-repeat; border: 1px solid var(--line); }
.tile .fileprev, .tile .tile-lock { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius-sm);
  background: var(--code-bg); border: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 8px; text-align: center; overflow: hidden; word-break: break-all; }
.tile .fileprev span { font-family: var(--mono); font-weight: 800; color: var(--accent-text); text-transform: uppercase; font-size: 18px; }
.tile .tile-lock .ic { width: 26px; height: 26px; color: var(--warn); }
.tile-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; min-width: 0; }
.tile-meta .nick { overflow: hidden; text-overflow: ellipsis; color: var(--text); font-weight: 500; }
.tile-meta .si { display: inline-flex; align-items: center; gap: 4px; }
.tile-meta .si .ic { width: 14px; height: 14px; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .tile-meta .si.v { display: none; } }

.skeleton { background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite;
  border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 5 / 3; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* viewer */
.paste-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.paste-head .ph-main { flex: 1; min-width: 260px; }
.paste-head h1 { word-break: break-word; margin: 8px 0 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.meta { color: var(--muted); font-size: 14px; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.meta .by { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; }
.meta .si { display: inline-flex; align-items: center; gap: 5px; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.part { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--code-bg); margin-bottom: 16px; box-shadow: var(--shadow); }
.part > .bar { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 13px; min-height: 44px; }
.part > .bar .fname { font-family: var(--mono); font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part > .bar .info { color: var(--muted); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
@media (max-width: 560px) { .part > .bar .info { display: none; } }
.code-scroll { overflow: auto; max-height: 78vh; }
table.lines { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; tab-size: 4; }
table.lines td { padding: 0; vertical-align: top; }
table.lines td.n { width: 1%; text-align: right; user-select: none; position: sticky; left: 0; background: var(--code-bg); border-right: 1px solid var(--line); }
table.lines td.n a { display: block; padding: 0 12px 0 16px; color: var(--faint); text-decoration: none; min-width: 48px; }
table.lines td.n a:hover { color: var(--text); }
table.lines td.s { padding: 0 16px; white-space: pre; }
table.lines tr:first-child td { padding-top: 12px; }
table.lines tr:last-child td { padding-bottom: 12px; }
table.lines.wrap td.s { white-space: pre-wrap; word-break: break-word; }
table.lines tr.sel td { background: var(--sel); }
table.lines tr.sel td.n a { color: var(--text); }
.hljs { background: transparent !important; padding: 0 !important; }

.markdown { padding: 24px 28px; line-height: 1.7; overflow-wrap: anywhere; background: var(--panel); }
.markdown > :first-child { margin-top: 0; }
.markdown img { max-width: 100%; }
.markdown pre { background: var(--code-bg); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--radius-sm); overflow: auto; }
.markdown code { font-family: var(--mono); font-size: .88em; background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }
.markdown pre code { background: none; padding: 0; }
.markdown table { border-collapse: collapse; }
.markdown td, .markdown th { border: 1px solid var(--line); padding: 6px 10px; }
.markdown blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--line-2); color: var(--muted); }
.markdown a { text-decoration: underline; }

.file-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 18px; background: var(--panel); }
.file-icon { width: 54px; height: 54px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center;
  font-family: var(--mono); font-weight: 800; color: var(--accent-text); font-size: 12px; text-transform: uppercase; }
.preview { padding: 0 18px 18px; background: var(--panel); }
.preview img, .preview video { max-width: 100%; max-height: 70vh; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block; }
.preview audio { width: 100%; }
.desc { white-space: pre-wrap; padding: 0 18px 18px; color: var(--text); background: var(--panel); }

.lock-card { max-width: 440px; margin: 48px auto; text-align: center; }
.lock-card .big-ic { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--warn-soft); color: var(--warn); }
.lock-card .big-ic .ic { width: 26px; height: 26px; }

/* comments */
.comments { margin-top: 28px; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; padding-top: 4px; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.comment .c-head .who { font-weight: 600; color: var(--text); }
.comment .c-text { white-space: pre-wrap; word-break: break-word; margin-top: 3px; font-size: 14.5px; }
.comment-form textarea { min-height: 84px; font-family: var(--sans); font-size: 14.5px; }

/* modal */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(5, 7, 10, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px 16px; animation: fade .12s ease-out; overflow-y: auto; }
.modal { width: 100%; max-width: 520px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); animation: pop .14s ease-out; }
.modal.wide { max-width: 920px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.qr-box { background: #fff; padding: 14px; border-radius: 12px; display: inline-block; line-height: 0; }
.qr-box svg { width: 220px; height: 220px; }
.snippet { font-family: var(--mono); font-size: 12.5px; min-height: 0; height: 74px; }

/* history + diff */
.rev-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.rev-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; background: none; color: var(--text); font: inherit; text-align: left; width: 100%; }
.rev-item:hover, .rev-item.on { background: var(--panel-2); border-color: var(--line); }
.history-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
@media (max-width: 700px) { .history-grid { grid-template-columns: 1fr; } }
.diff { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: auto; max-height: 60vh; background: var(--code-bg); }
.diff div { white-space: pre-wrap; word-break: break-word; padding: 0 12px 0 28px; position: relative; }
.diff div::before { position: absolute; left: 10px; color: var(--faint); }
.diff .a { background: var(--add); }
.diff .a::before { content: '+'; color: inherit; }
.diff .d { background: var(--del); }
.diff .d::before { content: '-'; color: inherit; }
.diff .gap { color: var(--faint); background: var(--panel-2); padding: 2px 12px; }
.diff-sum { font-family: var(--mono); font-size: 12.5px; }
.diff-sum .p { color: #2ea05a; }
.diff-sum .m { color: var(--danger); }

/* editor */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.editor-side { position: sticky; top: 78px; }
@media (max-width: 900px) { .editor-layout { grid-template-columns: 1fr; } .editor-side { position: static; } }
.title-input { font-size: 22px !important; font-weight: 700; padding: 10px 14px !important; margin-bottom: 14px; letter-spacing: -.3px; font-family: var(--sans) !important; }
.epart { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow); }
.epart-head { display: flex; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--panel-2); align-items: center; flex-wrap: wrap; }
.epart-head .pname { flex: 1; min-width: 140px; font-family: var(--mono); font-size: 13px; padding: 7px 10px; }
.epart-head select { width: auto; padding: 7px 10px; font-size: 13px; }
@media (max-width: 560px) {
  .epart-head .pname { flex-basis: 100%; }
  .epart-head select { flex: 1; min-width: 0; }
}
.epart-body { padding: 0; }
.epart-body textarea { border: 0; border-radius: 0; background: var(--code-bg) !important; min-height: 300px; padding: 14px 16px; box-shadow: none !important; }
.epart-body .markdown { min-height: 300px; border-top: 0; }
.epart-body .file-area { padding: 14px; }
.md-switch { padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
.add-part { width: 100%; border-style: dashed; color: var(--muted); padding: 12px; }
.side-section + .side-section { border-top: 1px solid var(--line); margin-top: 13px; padding-top: 13px; }
.side-pair { gap: 8px; }
.side-pair input, .side-pair select { min-width: 0; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel-2); }
table.t td { padding: 7px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
table.t tr:first-child td { border-top: 0; }
table.t td.actions { white-space: nowrap; text-align: right; }
table.t td.actions .btn { margin-left: 4px; }
table.t tbody tr:hover td { background: var(--panel-2); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .n { font-size: 24px; font-weight: 700; font-family: var(--mono); letter-spacing: -.5px; }
.stat .l { color: var(--muted); font-size: 13px; }

.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--text); }
.item:first-child { border-top: 0; }
.item:hover { background: var(--panel-2); text-decoration: none; }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: 13px; }
.item .when { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; grid-row: span 2; align-self: center; }
.nick { color: var(--accent-text); font-weight: 500; }

/* profile */
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.profile-head .pinfo { flex: 1; min-width: 220px; }
.profile-head h1 { margin: 0; }
.profile-head .handle { color: var(--muted); font-family: var(--mono); font-size: 14px; }
.profile-head .bio { margin: 10px 0 0; white-space: pre-wrap; }
.pstats { display: flex; gap: 22px; }
.pstats div { text-align: center; }
.pstats b { display: block; font-size: 20px; font-family: var(--mono); }
.pstats span { color: var(--muted); font-size: 12.5px; }

.auth-box { max-width: 420px; margin: 40px auto; }
.key-reveal { font-family: var(--mono); font-size: 13px; padding: 10px 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--radius-sm); word-break: break-all; }
pre.cmd { font-family: var(--mono); font-size: 12.5px; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; overflow: auto; margin: 8px 0 0; white-space: pre; }

/* toast */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 16px;
  border-radius: 10px; opacity: 0; transition: all .2s; pointer-events: none; z-index: 80; max-width: calc(100% - 32px); font-size: 14px; font-weight: 500; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--danger); color: #fff; }

footer { color: var(--faint); font-size: 13px; padding: 26px 20px 36px; border-top: 1px solid var(--line); }
footer .f-inner { max-width: 1160px; margin: 0 auto; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
footer a { color: var(--muted); }

/* v3 bits */
img.avatar { object-fit: cover; background: var(--panel-3); display: inline-block; }
.bell { position: relative; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); display: grid; place-items: center; }
.bell:hover, .bell.on { color: var(--text); border-color: var(--line-2); text-decoration: none; }
.bell .dot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.tag { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag:hover, .tag.on { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent-text) 45%, transparent); background: var(--accent-soft); text-decoration: none; }
.tags-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tile-tags { display: flex; gap: 8px; margin-top: -4px; font-family: var(--mono); font-size: 11.5px; color: var(--accent-text); overflow: hidden; white-space: nowrap; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: -6px 0 18px; }
.filters select { width: auto; padding: 6px 10px; font-size: 13px; }
.menu-pop { position: absolute; z-index: 70; min-width: 200px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 5px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .3); animation: pop .12s ease-out; }
.menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--text);
  font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.menu-pop button:hover { background: var(--panel-2); }
.menu-pop button.danger { color: var(--danger); }
.keys { display: grid; gap: 10px; }
.keys div { display: flex; align-items: center; gap: 10px; }
.keys kbd { min-width: 26px; text-align: center; }
.chart svg { width: 100%; height: 140px; display: block; fill: var(--accent-text); }
.chart svg rect:hover { fill: var(--accent); }
.chart-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 6px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.mini-stats div { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; }
.mini-stats b { display: block; font-family: var(--mono); font-size: 20px; }
.mini-stats span { color: var(--muted); font-size: 12.5px; }
@media (max-width: 520px) { .mini-stats { grid-template-columns: repeat(2, 1fr); } }
.comment .replies { margin-top: 6px; }
.comment .replies .comment { padding: 10px 0 4px; border-top: 0; }
.comment .c-actions { display: flex; gap: 2px; margin-top: 2px; }
.comment .c-actions .btn { padding: 3px 8px; font-size: 12.5px; }
.comment.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--sel); } }
.reply-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line);
  padding: 3px 4px 3px 10px; border-radius: 99px; margin-bottom: 8px; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--text); }
.notif:first-child { border-top: 0; }
.notif:hover { background: var(--panel-2); text-decoration: none; }
.notif.unread { background: var(--accent-soft); }
.notif .n-body { flex: 1; min-width: 0; }
.notif .n-snip { color: var(--muted); font-size: 13.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif .n-ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-3); color: var(--muted); margin-left: -22px; margin-top: 18px; border: 2px solid var(--panel); }
.notif .n-ic .ic { width: 12px; height: 12px; }
.notif .n-ic.like { color: var(--danger); }
.notif .n-ic.follow { color: var(--link); }
.notif .n-ic.fork, .notif .n-ic.comment, .notif .n-ic.reply, .notif .n-ic.mention { color: var(--accent-text); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; color: var(--text); border-radius: 8px; }
.user-row:hover { background: var(--panel-2); text-decoration: none; }
.pstats a { color: inherit; }
.pstats a:hover { text-decoration: none; }
.pstats a:hover b { color: var(--accent-text); }
.section-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 0 0 12px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }

/* v4: code themes */
[data-code-theme="github-dark"] { --code-bg: #0d1117; --code-fg: #e6edf3; --code-ln: #6e7681; --code-line: #21262d; --code-sel: rgba(56, 139, 253, .22); }
[data-code-theme="github-light"] { --code-bg: #ffffff; --code-fg: #1f2328; --code-ln: #8c959f; --code-line: #eaeef2; --code-sel: rgba(84, 174, 255, .3); }
[data-code-theme="dracula"] { --code-bg: #282a36; --code-fg: #f8f8f2; --code-ln: #6272a4; --code-line: #343746; --code-sel: rgba(189, 147, 249, .25); }
[data-code-theme="monokai"] { --code-bg: #272822; --code-fg: #f8f8f2; --code-ln: #75715e; --code-line: #3e3d32; --code-sel: rgba(230, 219, 116, .2); }
[data-code-theme="nord"] { --code-bg: #2e3440; --code-fg: #d8dee9; --code-ln: #616e88; --code-line: #3b4252; --code-sel: rgba(136, 192, 208, .22); }
table.lines { color: var(--code-fg, var(--text)); }
table.lines td.n a { color: var(--code-ln, var(--faint)); }
table.lines td.n { border-right-color: var(--code-line, var(--line)); }
html:not([data-code-theme="auto"]) table.lines tr.sel td { background: var(--code-sel); }
.part .code-scroll, .tile .snip { background: var(--code-bg); }
html:not([data-code-theme="auto"]) .tile .snip { color: var(--code-fg); opacity: .85; }

/* token colours for the editor when it isn't using a named theme */
:root, [data-theme="dark"] { --t-kw: #ff7b72; --t-str: #a5d6ff; --t-num: #79c0ff; --t-com: #8b949e; --t-def: #d2a8ff; --t-var: #ffa657; --t-tag: #7ee787; --t-attr: #79c0ff; }
[data-theme="light"] { --t-kw: #cf222e; --t-str: #0a3069; --t-num: #0550ae; --t-com: #6e7781; --t-def: #8250df; --t-var: #953800; --t-tag: #116329; --t-attr: #0550ae; }
[data-code-theme="github-dark"] { --t-kw: #ff7b72; --t-str: #a5d6ff; --t-num: #79c0ff; --t-com: #8b949e; --t-def: #d2a8ff; --t-var: #ffa657; --t-tag: #7ee787; --t-attr: #79c0ff; }
[data-code-theme="github-light"] { --t-kw: #cf222e; --t-str: #0a3069; --t-num: #0550ae; --t-com: #6e7781; --t-def: #8250df; --t-var: #953800; --t-tag: #116329; --t-attr: #0550ae; }
.cm-s-pf7.CodeMirror { background: var(--code-bg); color: var(--code-fg, var(--text)); }
.cm-s-pf7 .CodeMirror-gutters { background: var(--code-bg); border-right: 1px solid var(--code-line, var(--line)); }
.cm-s-pf7 .CodeMirror-linenumber { color: var(--code-ln, var(--faint)); }
.cm-s-pf7 .CodeMirror-cursor { border-left-color: var(--code-fg, var(--text)); }
.cm-s-pf7 .CodeMirror-selected, .cm-s-pf7.CodeMirror-focused .CodeMirror-selected { background: var(--code-sel, var(--accent-soft)); }
.cm-s-pf7 .CodeMirror-activeline-background { background: var(--code-line, var(--panel-2)); }
.cm-s-pf7 .cm-keyword, .cm-s-pf7 .cm-operator.cm-keyword { color: var(--t-kw); }
.cm-s-pf7 .cm-string, .cm-s-pf7 .cm-string-2 { color: var(--t-str); }
.cm-s-pf7 .cm-number, .cm-s-pf7 .cm-atom { color: var(--t-num); }
.cm-s-pf7 .cm-comment { color: var(--t-com); font-style: italic; }
.cm-s-pf7 .cm-def, .cm-s-pf7 .cm-variable-2 { color: var(--t-def); }
.cm-s-pf7 .cm-variable-3, .cm-s-pf7 .cm-type, .cm-s-pf7 .cm-builtin { color: var(--t-var); }
.cm-s-pf7 .cm-tag, .cm-s-pf7 .cm-header { color: var(--t-tag); }
.cm-s-pf7 .cm-attribute, .cm-s-pf7 .cm-property, .cm-s-pf7 .cm-qualifier { color: var(--t-attr); }
.cm-s-pf7 .cm-link { color: var(--link); }
.cm-s-pf7 .cm-strong { font-weight: 700; }
.cm-s-pf7 .cm-em { font-style: italic; }
.cm-s-pf7 .cm-bracket, .cm-s-pf7 .cm-meta { color: var(--muted); }
.CodeMirror-matchingbracket { outline: 1px solid var(--accent-text); color: inherit !important; }

/* editor */
.epart .CodeMirror { height: 340px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; }
.epart .CodeMirror pre.CodeMirror-placeholder { color: var(--faint); }
.ptools { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; min-height: 42px; }
.ptools .seg button { padding: 4px 11px; font-size: 13px; }
.ptools .status { font-size: 12.5px; font-family: var(--mono); display: inline-flex; align-items: center; gap: 5px; }
.ptools .status.ok { color: #2ea05a; }
.ptools .status.bad { color: var(--danger); }
.ebody { position: relative; }
.ebody.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ebody.split > .preview-pane { border-left: 1px solid var(--line); }
.preview-pane { min-height: 340px; max-height: 70vh; overflow: auto; background: var(--panel); }
.preview-pane .markdown { border: 0; min-height: 100%; }
.preview-pane iframe, .html-preview iframe { width: 100%; height: 100%; min-height: 340px; border: 0; background: #fff; display: block; }
.epart.full { position: fixed; inset: 0; z-index: 90; margin: 0; border-radius: 0; display: flex; flex-direction: column; }
.epart.full .ebody { flex: 1; min-height: 0; }
.epart.full .CodeMirror, .epart.full textarea, .epart.full .preview-pane { height: 100% !important; max-height: none; }
.epart.full .ebody:not(.split) .preview-pane { height: 100%; }
body.has-full { overflow: hidden; }
@media (max-width: 700px) { .ebody.split { grid-template-columns: 1fr; } .ebody.split > .preview-pane { border-left: 0; border-top: 1px solid var(--line); } }
.html-preview { height: 70vh; background: #fff; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.captcha { margin: 12px 0 4px; min-height: 65px; }

/* visibility badges */
.badge.unlisted { border-color: color-mix(in srgb, var(--warn) 50%, transparent); color: var(--warn); }
.badge.private { border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.badge.ok { border-color: color-mix(in srgb, #2ea05a 50%, transparent); color: #2ea05a; }
.seg button:disabled { opacity: .45; cursor: not-allowed; }

/* org tags */
.org-tag { --oc: var(--accent-text); font-family: var(--mono); font-weight: 750; font-size: .86em; color: var(--oc); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 2px; letter-spacing: .2px; vertical-align: baseline; }
a.org-tag:hover { text-decoration: none; filter: brightness(1.15); }
.org-tag.s-pill { background: color-mix(in srgb, var(--oc) 15%, transparent); border: 1px solid color-mix(in srgb, var(--oc) 45%, transparent);
  padding: 0 .55em; border-radius: 99px; line-height: 1.5; }
.org-tag .vcheck { width: .9em; height: .9em; stroke-width: 3; }
.org-tag.big { font-size: 1em; }
[data-theme="light"] .org-tag { filter: saturate(1.2) brightness(.82); }
.avatar.org-logo { border-radius: 22%; font-family: var(--mono); font-weight: 800; }

/* org page */
.org-banner { --c1: #b6f24a; --c2: #3b82f6; height: 110px; border-radius: var(--radius) var(--radius) 0 0; background: var(--c1); }
.org-banner.b-gradient { background: linear-gradient(135deg, var(--c1), var(--c2)); }
.org-banner.b-stripes { background: repeating-linear-gradient(45deg, var(--c1) 0 16px, var(--c2) 16px 32px); }
.org-banner.b-dots { background: radial-gradient(var(--c2) 2.5px, transparent 3px) 0 0 / 20px 20px, var(--c1); }
.org-banner.b-none { background: var(--panel-2); }
.org-card-head { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); margin-bottom: 22px; }
.org-info { display: flex; gap: 18px; padding: 0 22px 20px; flex-wrap: wrap; align-items: flex-end; }
.org-info .org-logo { margin-top: -38px; border: 4px solid var(--panel); box-sizing: content-box; }
.org-info .oi-main { flex: 1; min-width: 220px; padding-top: 12px; }
.org-info h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.org-desc { padding: 0 22px 18px; }
.org-desc .markdown { padding: 0; background: none; border: 0; }
.org-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; margin-top: 6px; }
.org-links a { display: inline-flex; align-items: center; gap: 6px; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.org-card { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); }
.org-card:hover { border-color: var(--accent-text); text-decoration: none; }
.org-card .oc-body { min-width: 0; }
.org-card .oc-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.member-row:first-child { border-top: 0; }
.member-row .m-body { flex: 1; min-width: 160px; }
.member-row .m-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.member-row .m-actions select, .member-row .m-actions input { width: auto; padding: 5px 8px; font-size: 13px; }
.role { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.role.owner { color: var(--warn); background: var(--warn-soft); }
.role.admin { color: var(--link); background: color-mix(in srgb, var(--link) 14%, transparent); }
.role .ic { width: 12px; height: 12px; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); cursor: pointer; }
.style-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 7px; }
.style-pick button { height: 40px; border-radius: 9px; border: 2px solid var(--line); cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: #0b0d10; }
.style-pick button.on { border-color: var(--text); }
.preview-strip { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.preview-strip .org-banner { height: 70px; border-radius: 0; }
.preview-strip .ps-body { padding: 12px 16px; background: var(--panel); display: flex; gap: 10px; align-items: center; font-size: 15px; }
.invite-link { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; flex-wrap: wrap; }
.invite-link .mono { flex: 1; min-width: 200px; word-break: break-all; }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.org-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel-2); color: var(--text); font-size: 13px; }
.org-chip:hover { border-color: var(--line-2); text-decoration: none; }
.profile-head h1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.profile-head h1 .org-tag { font-size: .62em; }
.profile-head h1 .at { font-family: var(--mono); font-size: .5em; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* collections */
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.coll-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); min-height: 140px; }
.coll-card:hover { border-color: var(--accent-text); text-decoration: none; }
.coll-card .cc-name { font-weight: 650; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.coll-card .cc-items { color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.coll-card .cc-items span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll-card .cc-items span::before { content: '· '; }
.tile-wrap { position: relative; }
.tile-wrap .tile-x { position: absolute; top: -9px; right: -9px; z-index: 2; background: var(--panel); border-radius: 50%; opacity: 0; transition: opacity .15s; }
.tile-wrap:hover .tile-x, .tile-wrap .tile-x:focus-visible { opacity: 1; }
@media (hover: none) { .tile-wrap .tile-x { opacity: 1; } }
.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; margin-bottom: 14px; }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 14px; margin: 0; }
.pick-list label:hover { background: var(--panel-2); }
.bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }

/* v5: code colours for "match site theme" come from the theme variables */
html[data-code-theme="auto"] .hljs { color: var(--code-fg, var(--text)); }
html[data-code-theme="auto"] .hljs-keyword, html[data-code-theme="auto"] .hljs-selector-tag, html[data-code-theme="auto"] .hljs-literal,
html[data-code-theme="auto"] .hljs-doctag, html[data-code-theme="auto"] .hljs-meta .hljs-keyword { color: var(--t-kw); }
html[data-code-theme="auto"] .hljs-string, html[data-code-theme="auto"] .hljs-regexp, html[data-code-theme="auto"] .hljs-meta .hljs-string,
html[data-code-theme="auto"] .hljs-char\.escape_ { color: var(--t-str); }
html[data-code-theme="auto"] .hljs-number, html[data-code-theme="auto"] .hljs-symbol, html[data-code-theme="auto"] .hljs-bullet,
html[data-code-theme="auto"] .hljs-variable\.constant_ { color: var(--t-num); }
html[data-code-theme="auto"] .hljs-comment, html[data-code-theme="auto"] .hljs-quote { color: var(--t-com); font-style: italic; }
html[data-code-theme="auto"] .hljs-title, html[data-code-theme="auto"] .hljs-title\.function_, html[data-code-theme="auto"] .hljs-section { color: var(--t-def); }
html[data-code-theme="auto"] .hljs-type, html[data-code-theme="auto"] .hljs-built_in, html[data-code-theme="auto"] .hljs-title\.class_,
html[data-code-theme="auto"] .hljs-params { color: var(--t-var); }
html[data-code-theme="auto"] .hljs-name, html[data-code-theme="auto"] .hljs-tag, html[data-code-theme="auto"] .hljs-selector-id,
html[data-code-theme="auto"] .hljs-selector-class { color: var(--t-tag); }
html[data-code-theme="auto"] .hljs-attr, html[data-code-theme="auto"] .hljs-attribute, html[data-code-theme="auto"] .hljs-property,
html[data-code-theme="auto"] .hljs-variable, html[data-code-theme="auto"] .hljs-template-variable, html[data-code-theme="auto"] .hljs-meta { color: var(--t-attr); }
html[data-code-theme="auto"] .hljs-addition { color: var(--t-tag); background: var(--add); }
html[data-code-theme="auto"] .hljs-deletion { color: var(--danger); background: var(--del); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* topbar buttons */
.top-right .theme-btn { flex: none; }
.nav .m-only { display: none; }
@media (max-width: 760px) { .nav .m-only { display: inline-flex; } }
@media (max-width: 520px) { .top-right .tp-btn, .top-right .theme-btn.mode { display: none; } .topbar-inner { gap: 8px; padding: 10px 14px; } }

/* theme picker */
.theme-pop { position: absolute; z-index: 70; width: min(360px, calc(100vw - 16px)); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 10px; box-shadow: 0 16px 44px rgba(0, 0, 0, .35); animation: pop .12s ease-out; }
.tp-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 2px 4px 8px; }
.tp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tp-item { display: flex; flex-direction: column; gap: 6px; align-items: stretch; padding: 6px; border-radius: 10px; border: 1px solid transparent; background: none;
  color: var(--text); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; text-align: left; }
.tp-item:hover { background: var(--panel-2); }
.tp-item.on { border-color: var(--accent-text); background: var(--accent-soft); }
.tp-sw { display: block; height: 46px; border-radius: 8px; border: 1px solid; padding: 7px; position: relative; overflow: hidden; }
.tp-sw > span { display: flex; gap: 4px; align-items: center; height: 100%; border-radius: 5px; border: 1px solid; padding: 0 6px; }
.tp-sw i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.tp-sw i:last-child { width: auto; flex: 1; height: 3px; border-radius: 3px; opacity: .6; }
.tp-foot { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 4px 2px; margin-top: 8px; border-top: 1px solid var(--line); font-size: 13.5px; }
.tp-foot a { display: inline-flex; align-items: center; gap: 6px; }

/* theme effects */
[data-effect] body { background: transparent; }
[data-effect] html, html[data-effect] { background: var(--bg); }
html[data-effect="glow"] .btn.primary, html[data-effect="glow"] .logo-mark { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent); }
html[data-effect="glow"] .tile, html[data-effect="glow"] .org-card, html[data-effect="glow"] .coll-card { box-shadow: 0 0 0 1px transparent, 0 0 24px color-mix(in srgb, var(--accent) 5%, transparent); }
html[data-effect="glow"] .tile:hover, html[data-effect="glow"] .org-card:hover, html[data-effect="glow"] .coll-card:hover {
  box-shadow: 0 0 0 1px var(--accent-text), 0 0 30px color-mix(in srgb, var(--accent) 28%, transparent); }
html[data-effect="glow"] .tabs button.on, html[data-effect="glow"] .nav a.active { text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent); }
html[data-effect="glow"] input:focus, html[data-effect="glow"] textarea:focus { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 20px color-mix(in srgb, var(--accent) 20%, transparent); }

html[data-effect="scanlines"] body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 200;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px); }
html[data-effect="scanlines"] body { text-shadow: 0 0 5px color-mix(in srgb, var(--text) 40%, transparent); }
html[data-effect="scanlines"] .logo::after { content: '_'; color: var(--accent); animation: blink 1.05s steps(1) infinite; margin-left: -8px; }
html[data-effect="scanlines"] .logo-mark { border-radius: 2px; }
html[data-effect="scanlines"] .avatar { border-radius: 3px; }
html[data-effect="scanlines"] ::selection { background: var(--accent); color: var(--accent-ink); }
@keyframes blink { 50% { opacity: 0; } }

html[data-effect="synthgrid"] { background: radial-gradient(ellipse 90% 60% at 50% 115%, color-mix(in srgb, var(--g1) 38%, transparent) 0, transparent 60%), var(--bg); background-attachment: fixed; }
html[data-effect="synthgrid"] body::before { content: ''; position: fixed; left: -50%; right: -50%; bottom: -2px; height: 42vh; z-index: -1; pointer-events: none;
  background-image: linear-gradient(color-mix(in srgb, var(--g2) 70%, transparent) 1.5px, transparent 1.5px), linear-gradient(90deg, color-mix(in srgb, var(--g1) 80%, transparent) 1.5px, transparent 1.5px);
  background-size: 56px 56px; transform: perspective(260px) rotateX(62deg); transform-origin: bottom center; opacity: .45;
  -webkit-mask-image: linear-gradient(transparent, #000 70%); mask-image: linear-gradient(transparent, #000 70%); animation: gridrun 2.4s linear infinite; }
html[data-effect="synthgrid"] h1 { text-shadow: 0 0 22px color-mix(in srgb, var(--g1) 55%, transparent); }
html[data-effect="synthgrid"] .logo-mark { background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 0 18px color-mix(in srgb, var(--g1) 60%, transparent); }
html[data-effect="synthgrid"] .btn.primary { box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 50%, transparent); }
@keyframes gridrun { to { background-position: 0 56px; } }

html[data-effect="glass"] body::before { content: ''; position: fixed; inset: -25%; z-index: -1; pointer-events: none; opacity: .62; filter: blur(70px);
  background: radial-gradient(circle at 22% 28%, var(--g1) 0, transparent 30%), radial-gradient(circle at 78% 22%, var(--g2) 0, transparent 26%),
    radial-gradient(circle at 62% 78%, color-mix(in srgb, var(--g1) 60%, #ff5fd2) 0, transparent 30%), radial-gradient(circle at 18% 82%, color-mix(in srgb, var(--g2) 70%, #4ade80) 0, transparent 24%);
  animation: blobs 26s ease-in-out infinite alternate; }
@keyframes blobs { 50% { transform: translate(4%, -3%) rotate(8deg) scale(1.06); } to { transform: translate(-3%, 4%) rotate(-6deg) scale(1.1); } }
html[data-effect="glass"] .card, html[data-effect="glass"] .tile, html[data-effect="glass"] .part, html[data-effect="glass"] .epart, html[data-effect="glass"] .org-card-head,
html[data-effect="glass"] .table-wrap, html[data-effect="glass"] .list, html[data-effect="glass"] .stat, html[data-effect="glass"] .org-card,
html[data-effect="glass"] .coll-card, html[data-effect="glass"] .potw, html[data-effect="glass"] .lb-list {
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); }
html[data-effect="glass"] .modal, html[data-effect="glass"] .menu-pop, html[data-effect="glass"] .theme-pop, html[data-effect="glass"] .cmdk,
html[data-effect="glass"] .ctx, html[data-effect="glass"] .findbar { background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5); }
html[data-effect="glass"] .nav.open { background: color-mix(in srgb, var(--bg) 85%, transparent); }

html[data-effect="paper"] { background-image: radial-gradient(rgba(60, 40, 10, .05) 1px, transparent 1.2px); background-size: 5px 5px; }
html[data-effect="paper"] table.lines { background-image: repeating-linear-gradient(transparent 0 calc(1.6em - 1px), rgba(138, 59, 18, .13) calc(1.6em - 1px) 1.6em);
  background-position: 0 12px; background-repeat: repeat-y; }
html[data-effect="paper"] table.lines td.n { border-right: 2px solid rgba(220, 38, 38, .35); }
html[data-effect="paper"] .card, html[data-effect="paper"] .tile, html[data-effect="paper"] .part { box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 3px 4px 0 rgba(60, 40, 10, .06); }
html[data-effect="paper"] h1 { font-weight: 700; letter-spacing: -.3px; }
html[data-effect="paper"] .tile-title, html[data-effect="paper"] .modal-head h2 { font-family: var(--head); }

html[data-effect="gradient"] { background: linear-gradient(165deg, color-mix(in srgb, var(--g1) 16%, var(--bg)) 0, var(--bg) 38%, var(--bg) 62%, color-mix(in srgb, var(--g2) 18%, var(--bg)) 100%); background-attachment: fixed; }
html[data-effect="gradient"] .btn.primary, html[data-effect="gradient"] .logo-mark { background: linear-gradient(135deg, var(--g1), var(--g2)); border-color: transparent; color: #fff; }
html[data-effect="gradient"] main h1 { background: linear-gradient(90deg, var(--g1), var(--g2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-effect="gradient"] .tabs button.on { border-image: linear-gradient(90deg, var(--g1), var(--g2)) 1; }
html[data-effect="gradient"] .topbar { box-shadow: 0 1px 0 color-mix(in srgb, var(--g1) 35%, transparent); }
html[data-effect="gradient"] .switch input:checked { background: linear-gradient(135deg, var(--g1), var(--g2)); }

html[data-effect="contrast"] * { box-shadow: none !important; text-shadow: none !important; }
html[data-effect="contrast"] .card, html[data-effect="contrast"] .tile, html[data-effect="contrast"] .part, html[data-effect="contrast"] .btn, html[data-effect="contrast"] input,
html[data-effect="contrast"] select, html[data-effect="contrast"] textarea, html[data-effect="contrast"] .seg, html[data-effect="contrast"] .modal,
html[data-effect="contrast"] .menu-pop, html[data-effect="contrast"] .list, html[data-effect="contrast"] .table-wrap, html[data-effect="contrast"] .org-card,
html[data-effect="contrast"] .coll-card, html[data-effect="contrast"] .epart { border-width: 2px !important; }
html[data-effect="contrast"] main a:not(.btn):not(.tile):not(.org-card):not(.coll-card):not(.tag) { text-decoration: underline; }
html[data-effect="contrast"] :focus-visible { outline: 3px solid var(--accent) !important; outline-offset: 2px; }
html[data-effect="contrast"] .tile .snip { -webkit-mask-image: none; mask-image: none; }

html[data-effect="soft"] { background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--g2) 20%, var(--bg)) 0, var(--bg) 55%), var(--bg); background-attachment: fixed; }
html[data-effect="soft"] .btn, html[data-effect="soft"] .seg, html[data-effect="soft"] .tabs button, html[data-effect="soft"] .nav a { border-radius: 999px; }
html[data-effect="soft"] .seg button { border-radius: 999px; }
html[data-effect="soft"] .tile:hover { transform: translateY(-3px) scale(1.01); }

html[data-effect="dots"] { background: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1.6px) 0 0 / 22px 22px, var(--bg); }

/* cards and lists animate in, pages cross fade */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .16s ease-in both; }
::view-transition-new(root) { animation: vt-in .22s ease-out both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
.tile, .org-card, .coll-card, .lb-row, .theme-card { animation: rise .38s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* command menu and search */
.cmdk-back { position: fixed; inset: 0; z-index: 95; background: rgba(5, 7, 10, .5); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start;
  padding: 11vh 14px 14px; animation: fade .1s ease-out; }
.cmdk { width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
  overflow: hidden; animation: pop .14s ease-out; display: flex; flex-direction: column; max-height: 76vh; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmdk-in .ic { width: 18px; height: 18px; }
.cmdk-in input { border: 0 !important; background: none !important; box-shadow: none !important; padding: 6px 0; font-size: 16.5px; color: var(--text); }
.cmdk-list { overflow-y: auto; padding: 6px; flex: 1; }
.cmdk-group { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--faint); padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; color: var(--text);
  font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.cmdk-item.on { background: var(--accent-soft); }
.cmdk-item > .ic { color: var(--muted); }
.cmdk-item.on > .ic { color: var(--accent-text); }
.ci-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ci-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ci-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-snip { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.ci-hint { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.cmdk mark, .ci-title mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.cmdk-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.cmdk-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--panel-2); }
@media (max-width: 560px) { .cmdk-foot { display: none; } .cmdk-back { padding-top: 8px; } }

/* find on page */
mark.pf7-hit { background: color-mix(in srgb, var(--warn) 38%, transparent); color: inherit; border-radius: 2px; }
mark.pf7-hit.cur { background: var(--warn); color: #000; box-shadow: 0 0 0 2px var(--warn); }
.findbar { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 85; display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 36px rgba(0, 0, 0, .3); animation: pop .12s ease-out; color: var(--muted); }
.findbar input { width: 190px; border: 0 !important; background: none !important; box-shadow: none !important; padding: 5px 4px; }
.findbar .fb-n { font-family: var(--mono); font-size: 12px; white-space: nowrap; min-width: 64px; text-align: right; padding-right: 4px; }
@media (max-width: 480px) { .findbar { left: 10px; right: 10px; transform: none; } .findbar input { width: auto; flex: 1; } }

/* right click menu */
.ctx { position: fixed; z-index: 99; min-width: 236px; max-width: 300px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 5px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .38); animation: pop .1s ease-out; font-size: 13.5px; }
.ctx-nav { display: flex; gap: 2px; padding: 2px 2px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.ctx-nav button { flex: 1; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.ctx-nav button:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.ctx-nav button:disabled { opacity: .35; cursor: default; }
.ctx-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 9px; border: 0; border-radius: 7px; background: none; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; outline: none; }
.ctx-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-item:hover, .ctx-item:focus-visible, .ctx-item:focus { background: var(--accent-soft); }
.ctx-item .ic { color: var(--muted); }
.ctx-item kbd { font-size: 10px; }
.ctx .sep { height: 1px; background: var(--line); margin: 4px 6px; }
.ctx-hint { font-size: 11px; color: var(--faint); padding: 6px 9px 3px; border-top: 1px solid var(--line); margin-top: 4px; }

/* new pastes pill on explore */
.new-pill { position: sticky; top: 70px; z-index: 20; display: flex; justify-content: center; height: 0; overflow: visible; }
.new-pill button { transform: translateY(-6px); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); border-radius: 99px; animation: pop .2s ease-out; }

/* paste of the week */
.potw { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; padding: 18px; margin-bottom: 22px; border-radius: var(--radius); color: var(--text);
  background: linear-gradient(135deg, color-mix(in srgb, var(--warn) 12%, var(--panel)), var(--panel) 55%); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); box-shadow: var(--shadow); }
.potw:hover { text-decoration: none; border-color: var(--warn); }
.potw .pw-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--warn); }
.potw h2 { font-size: 22px; margin: 8px 0 6px; letter-spacing: -.4px; }
.potw .pw-note { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.potw .snip { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--code-fg, var(--muted)); background: var(--code-bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; max-height: 170px; overflow: hidden; white-space: pre-wrap; word-break: break-word;
  -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.badge.potw-b { border-color: color-mix(in srgb, var(--warn) 55%, transparent); color: var(--warn); }
@media (max-width: 700px) { .potw { grid-template-columns: 1fr; } }

/* reactions */
.reacts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: -6px 0 18px; }
.react { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; transition: transform .1s, border-color .15s, background .15s; }
.react:hover { border-color: var(--line-2); }
.react:active { transform: scale(.94); }
.react.mine { border-color: color-mix(in srgb, var(--accent-text) 55%, transparent); background: var(--accent-soft); }
.react .e { font-size: 15px; line-height: 1; }
.react b { font-weight: 600; font-variant-numeric: tabular-nums; }
.react.add { color: var(--muted); padding: 4px 9px; }
.react-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px; }
.react-pick button { font-size: 22px; padding: 7px; border: 0; background: none; border-radius: 9px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); }
.react-pick button span { font-size: 10.5px; }
.react-pick button:hover, .react-pick button.mine { background: var(--panel-2); }
.react.pulse { animation: pulse .35s ease-out; }
@keyframes pulse { 40% { transform: scale(1.18); } }

/* achievements */
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ach { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  background: color-mix(in srgb, var(--pa, var(--accent)) 13%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--pa, var(--accent-text)) 40%, transparent); color: var(--text); cursor: default; }
.ach .ic { width: 14px; height: 14px; color: var(--pa, var(--accent-text)); }
.ach.locked { background: var(--panel-2); border-color: var(--line); color: var(--faint); }
.ach.locked .ic { color: var(--faint); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ach-card { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.ach-card .ac-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.ach-card.locked { opacity: .55; }
.ach-card.locked .ac-ic { background: var(--panel-3); color: var(--faint); }
.ach-card .bar { height: 5px; border-radius: 9px; background: var(--panel-3); margin-top: 6px; overflow: hidden; }
.ach-card .bar i { display: block; height: 100%; background: var(--accent-text); border-radius: 9px; }

/* profile customisation */
.profile-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.profile-wrap .profile-head { margin: 0; border: 0; box-shadow: none; border-radius: 0; background: none; }
.profile-banner { height: 130px; background: linear-gradient(135deg, var(--pa, var(--accent)), color-mix(in srgb, var(--pa, var(--accent)) 30%, var(--bg))); background-size: cover; background-position: center; }
.profile-banner.has-img { background-color: var(--panel-2); }
.profile-wrap .profile-head { align-items: flex-start; }
.profile-wrap .profile-head > .avatar:first-child { margin-top: -50px; border: 4px solid var(--panel); box-sizing: content-box; }
.profile-wrap .profile-head .pstats, .profile-wrap .profile-head > .btn { align-self: center; }
.profile-wrap.no-banner .profile-banner { height: 0; }
.profile-wrap.no-banner .profile-head { align-items: center; }
.profile-wrap.no-banner .profile-head > .avatar:first-child { margin-top: 0; border: 0; }
.org-lvl { padding: 0 22px 16px; }
.plinks { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.plinks a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
.plinks a:hover { border-color: var(--pa, var(--accent-text)); text-decoration: none; }
.plinks a .ic { width: 13px; height: 13px; color: var(--pa, var(--accent-text)); }
.profile-wrap[style*="--pa"] .btn.primary { background: var(--pa); border-color: var(--pa); color: #0b0d10; }
.theme-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: -10px 0 16px; }
.link-rows .lr { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 8px; margin-bottom: 8px; }
@media (max-width: 560px) { .link-rows .lr { grid-template-columns: 1fr auto; } .link-rows .lr input:first-child { grid-column: 1 / -1; } }
.banner-prev { height: 90px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2) center / cover no-repeat; margin-bottom: 10px; }

/* leaderboard */
.lb-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; box-shadow: var(--shadow); }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--text); }
.lb-row:first-child { border-top: 0; }
.lb-row:hover { background: var(--panel-2); text-decoration: none; }
.lb-rank { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-weight: 800; font-size: 13px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.lb-row:nth-child(1) .lb-rank { background: linear-gradient(135deg, #ffd76a, #e0a100); color: #3a2a00; border: 0; }
.lb-row:nth-child(2) .lb-rank { background: linear-gradient(135deg, #e8edf3, #a9b4c2); color: #23303d; border: 0; }
.lb-row:nth-child(3) .lb-rank { background: linear-gradient(135deg, #f3b98a, #c27236); color: #3b1d06; border: 0; }
.lb-main { flex: 1; min-width: 0; }
.lb-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--accent-text); white-space: nowrap; text-align: right; }
.lb-score span { display: block; font-size: 11px; font-weight: 500; color: var(--faint); }
.lb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .lb-layout { grid-template-columns: 1fr; } }
.potw-hist a { display: flex; gap: 10px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--line); color: var(--text); font-size: 14px; }
.potw-hist a:first-child { border-top: 0; }
.potw-hist a:hover { text-decoration: none; color: var(--accent-text); }

/* org levels, announcements and activity */
.lvl { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 99px;
  background: color-mix(in srgb, var(--oc, var(--accent)) 16%, transparent); color: var(--oc, var(--accent-text)); border: 1px solid color-mix(in srgb, var(--oc, var(--accent)) 40%, transparent); }
.lvl .ic { width: 12px; height: 12px; }
.lvl-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.lvl-bar { width: 160px; height: 7px; border-radius: 9px; background: var(--panel-3); overflow: hidden; }
.lvl-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--oc, var(--accent)), color-mix(in srgb, var(--oc, var(--accent)) 50%, #fff)); }
.perks { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.perks li { display: flex; align-items: center; gap: 8px; color: var(--faint); }
.perks li.on { color: var(--text); }
.perks li .ic { color: var(--faint); }
.perks li.on .ic { color: #2ea05a; }
.org-ann { display: flex; gap: 12px; align-items: flex-start; margin: 0 22px 18px; padding: 12px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--oc, var(--accent)) 10%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--oc, var(--accent)) 35%, var(--line)); }
.org-ann .ic { color: var(--oc, var(--accent-text)); margin-top: 3px; }
.org-ann .oa-when { font-size: 12px; color: var(--muted); }
.act { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.act-row { display: flex; gap: 12px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.act-row:first-child { border-top: 0; }
.act-row .a-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); flex: none; }
.act-row .a-ic.paste { color: var(--accent-text); }
.act-row .a-ic.join { color: var(--link); }
.act-row .a-ic.news { color: var(--warn); }
.act-row .a-ic.potw { color: var(--warn); background: var(--warn-soft); }
.act-row .a-body { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.act-row .a-when { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.org-banner.b-animated { background: linear-gradient(115deg, var(--c1), var(--c2), var(--c1), var(--c2)); background-size: 300% 300%; animation: bannerflow 9s ease-in-out infinite; }
@keyframes bannerflow { 50% { background-position: 100% 50%; } }
.org-tag.s-glow { text-shadow: 0 0 8px color-mix(in srgb, var(--oc) 80%, transparent), 0 0 18px color-mix(in srgb, var(--oc) 50%, transparent); animation: tagglow 2.6s ease-in-out infinite; }
@keyframes tagglow { 50% { text-shadow: 0 0 4px color-mix(in srgb, var(--oc) 60%, transparent); } }
.org-card.gold { border-color: #e0a100; box-shadow: 0 0 0 1px #e0a10055, var(--shadow); }
.style-pick button .lock { display: block; font-size: 10px; font-weight: 600; opacity: .85; }
.style-pick button:disabled { cursor: not-allowed; filter: grayscale(.7); opacity: .55; }

/* run code */
.run-out { border-top: 1px solid var(--line); background: #07090c; color: #d7dde4; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
[data-theme="light"] .run-out { background: #0f141a; }
.run-out .ro-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border-bottom: 1px solid #1c232c; color: #8b94a1; font-size: 12px; }
.run-out .ro-head .dot { width: 8px; height: 8px; border-radius: 50%; background: #5d6672; }
.run-out .ro-head .dot.busy { background: #ffb547; animation: blink 1s steps(1) infinite; }
.run-out .ro-head .dot.ok { background: #46c878; }
.run-out .ro-head .dot.bad { background: #ff5c6c; }
.run-out pre { margin: 0; padding: 10px 14px 14px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.run-out .err { color: #ff8a95; }
.run-out .warn { color: #ffc46b; }
.run-out .info { color: #6b7684; }
.btn.run { color: #2ea05a; }
.btn.run:hover { border-color: #2ea05a; background: rgba(46, 160, 90, .1); }

/* side by side diff */
.diff-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.diff-tools select { width: auto; padding: 5px 8px; font-size: 13px; }
.sbs-wrap { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: auto; max-height: 60vh; background: var(--code-bg); }
table.sbs { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; table-layout: fixed; color: var(--code-fg, var(--text)); }
table.sbs td { padding: 0 10px; vertical-align: top; white-space: pre-wrap; word-break: break-word; }
table.sbs td.ln { width: 44px; text-align: right; color: var(--code-ln, var(--faint)); user-select: none; padding: 0 8px; border-right: 1px solid var(--line); }
table.sbs td.mid { border-left: 1px solid var(--line-2); }
table.sbs tr.gap td { background: var(--panel-2); color: var(--faint); padding: 2px 10px; text-align: center; }
table.sbs td.d { background: var(--del); }
table.sbs td.a { background: var(--add); }
table.sbs td.e { background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--line) 50%, transparent) 6px 7px); }
table.sbs mark.dw { background: color-mix(in srgb, var(--danger) 35%, transparent); color: inherit; border-radius: 2px; }
table.sbs mark.aw { background: color-mix(in srgb, #2ea05a 40%, transparent); color: inherit; border-radius: 2px; }
.diff mark.dw { background: color-mix(in srgb, var(--danger) 35%, transparent); color: inherit; }
.diff mark.aw { background: color-mix(in srgb, #2ea05a 40%, transparent); color: inherit; }

/* live editing */
.live-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #ff5c6c; }
.live-chip i { width: 8px; height: 8px; border-radius: 50%; background: #ff5c6c; animation: livepulse 1.4s ease-in-out infinite; }
@keyframes livepulse { 50% { box-shadow: 0 0 0 5px rgba(255, 92, 108, .2); } }
.live-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.peers { display: flex; align-items: center; }
.peer { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #0b0d10; border: 2px solid var(--bg);
  margin-left: -8px; text-transform: uppercase; }
.peer:first-child { margin-left: 0; }
.live-status { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.live-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #46c878; }
.live-status.saving .dot { background: #ffb547; }
.live-status.off .dot { background: #ff5c6c; }
.live-ed { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--code-bg); }
.live-ed .CodeMirror { height: calc(100vh - 250px); min-height: 360px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; }
.live-ed textarea { min-height: 60vh; border: 0; border-radius: 0; }
.cm-peer { position: relative; border-left: 2px solid var(--pc); margin-left: -1px; height: 1.3em; display: inline-block; vertical-align: text-bottom; pointer-events: none; }
.cm-peer span { position: absolute; bottom: 100%; left: -2px; background: var(--pc); color: #0b0d10; font-family: var(--sans); font-size: 10.5px; font-weight: 700;
  padding: 0 5px; border-radius: 4px 4px 4px 0; white-space: nowrap; line-height: 1.5; }
.share-box { display: flex; gap: 8px; align-items: center; }
.share-box input { font-family: var(--mono); font-size: 12.5px; }

/* themes page */
.themes-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .themes-layout { grid-template-columns: 1fr; } }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.theme-card { border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.theme-card.on { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text), var(--shadow); }
.theme-card .tc-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.theme-card .tc-name { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.theme-card .tc-by { font-size: 12.5px; color: var(--muted); }
.theme-card .tc-actions { display: flex; gap: 6px; padding: 0 14px 14px; flex-wrap: wrap; }
.mini { --r: 8px; padding: 12px; background: var(--m-bg); font-family: var(--m-font); color: var(--m-text); height: 150px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.mini .m-top { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-weight: 800; font-size: 12px; }
.mini .m-mark { width: 18px; height: 18px; border-radius: 5px; background: var(--m-accent); color: var(--m-ink); display: grid; place-items: center; font-size: 9px; }
.mini .m-pill { margin-left: auto; padding: 2px 8px; border-radius: 99px; background: var(--m-accent); color: var(--m-ink); font-size: 10px; font-family: var(--m-font); font-weight: 700; }
.mini .m-card { flex: 1; border: 1px solid var(--m-line); background: var(--m-panel); border-radius: var(--r); padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.mini .m-title { font-size: 12px; font-weight: 700; font-family: var(--m-head); }
.mini .m-code { flex: 1; background: var(--m-code); border-radius: calc(var(--r) * .7); padding: 6px 8px; font-family: var(--mono); font-size: 10.5px; line-height: 1.5; white-space: pre; overflow: hidden; color: var(--m-text); }
.mini .m-meta { font-size: 10px; color: var(--m-muted); }
.editor-card .field { margin-bottom: 12px; }
.col-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
@media (max-width: 960px) and (min-width: 560px) { .col-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; } }
.save-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.save-grid .btn { width: 100%; }
.col-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.col-field input[type=color] { width: 34px; height: 28px; padding: 1px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-2); cursor: pointer; flex: none; }
.col-field input[type=text] { padding: 4px 7px; font-family: var(--mono); font-size: 12px; width: 92px; }
.col-field span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 18px 0 8px; }
.sticky-side { position: sticky; top: 78px; }
@media (max-width: 960px) { .sticky-side { position: static; } }
.badge.org { border-color: color-mix(in srgb, var(--warn) 50%, transparent); color: var(--warn); }
#vis-seg:has(#vis-org:not(.hidden)) { display: grid; grid-template-columns: 1fr 1fr; }
.acct-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.acct-cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.acct-cols .card > h2:first-child { margin-top: 0; }
@media (max-width: 960px) { .acct-cols.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .acct-cols, .acct-cols.three { grid-template-columns: 1fr; } }

/* staff panel */
main.staff-main { max-width: 1400px; }
.staff-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 26px; align-items: start; }
.staff-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.sn-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 14px 10px 6px; }
.sn-group:first-child { margin-top: 0; }
.staff-nav button { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; font-weight: 500;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.staff-nav button:hover { background: var(--panel-2); color: var(--text); }
.staff-nav button.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.staff-nav button > span:not(.sn-n) { flex: 1; }
.sn-n { font-size: 11px; font-weight: 700; font-family: var(--mono); padding: 1px 7px; border-radius: 99px; background: var(--panel-3); color: var(--text); }
.sn-n.warn { background: var(--danger); color: #fff; }
.staff-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.staff-cols.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.staff-cols .card h2, .grid2 .card h2 { font-size: 16px; }
.list.flat { border: 0; background: none; border-radius: 0; }
.stat.warn { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.stat.warn .n { color: var(--danger); }
.stat[data-goto]:hover { border-color: var(--line-2); transform: translateY(-1px); }
.hbars { display: flex; flex-direction: column; gap: 7px; }
.hb { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
.hb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.hb i { height: 8px; border-radius: 9px; background: var(--accent); min-width: 3px; }
.hb b { font-family: var(--mono); font-size: 12.5px; text-align: right; }
.q-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.q-list { display: flex; flex-direction: column; gap: 10px; }
.qcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; outline: none; transition: opacity .18s, transform .18s, border-color .12s; }
.qcard.sel { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text); }
.qcard.gone { opacity: 0; transform: translateX(20px); }
.qc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qc-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.qc-who { font-size: 13px; color: var(--muted); margin-top: 4px; }
.qc-body { margin: 10px 0 0; max-height: 120px; overflow: hidden; font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  white-space: pre-wrap; word-break: break-word; }
.qc-why { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; font-size: 13px; color: var(--danger); }
.qc-why .ic { flex: none; margin-top: 2px; }
.qc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.bulk-bar { position: sticky; top: 70px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px;
  background: var(--panel); border: 1px solid var(--accent-text); border-radius: var(--radius); box-shadow: var(--shadow); }
.bulk-bar select, .bulk-bar input { padding: 6px 10px; font-size: 13px; }
.modal.drawer { max-width: 980px; }
.ud-head { display: flex; gap: 14px; align-items: flex-start; }
.ud-name { font-size: 19px; font-weight: 700; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 16px 0; }
.kv > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-width: 0; }
.kv b { display: block; font-family: var(--mono); font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv b.bad { color: var(--danger); }
.kv span { font-size: 12px; color: var(--muted); }
.ud-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.ud-actions > div { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ud-label { width: 92px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.staff-pre { margin: 0; max-height: 360px; overflow: auto; padding: 12px 14px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 1000px) {
  .staff-layout { grid-template-columns: 1fr; }
  .staff-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .sn-group { display: none; }
  .staff-cols, .staff-cols.two, .q-cols { grid-template-columns: 1fr; }
  .ud-label { width: 100%; }
}
.site-strip { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 9px 20px; font-size: 13.5px; font-weight: 500; text-align: center;
  background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.site-strip.danger { background: var(--danger-soft); color: var(--danger); border-bottom-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.site-strip .ic { flex: none; }
.staff-av { display: grid; place-items: center; border-radius: 50%; background: var(--warn-soft); color: var(--warn); flex: none; }
.notif .n-ic.staff_warn, .notif .n-ic.staff_mute { color: var(--danger); }
.notif .n-ic.staff_msg { color: var(--warn); }
.verified-tick { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--link); color: #fff; vertical-align: 2px; margin-left: 4px; }
.verified-tick .ic { width: 11px; height: 11px; }

/* settings forms that split into two columns on wide screens */
.set-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.set-cols > div + div { border-left: 1px solid var(--line); padding-left: 32px; }
.set-foot { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; display: flex; justify-content: flex-end; }
.danger-zone.row { align-items: center; gap: 16px; }
.ex-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 860px) {
  .set-cols, .ex-grid { grid-template-columns: 1fr; }
  .set-cols > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
}

/* legal pages */
.legal-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 26px; align-items: start; max-width: 1040px; margin: 0 auto; }
.legal-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.legal-nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.legal-nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.legal-nav a.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.legal { padding: 30px 36px; line-height: 1.7; font-size: 15px; }
.legal h1 { margin: 0 0 2px; font-size: 28px; }
.legal-date { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.legal h2 { font-size: 17px; margin: 26px 0 6px; }
.legal ul, .legal ol { padding-left: 22px; margin: 6px 0 12px; }
.legal li { margin-bottom: 5px; }
.legal p { margin: 6px 0 12px; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-bottom: 8px; line-height: 1.5; cursor: pointer; }
.check-line input { width: auto; margin-top: 4px; flex: none; }
@media (max-width: 860px) {
  .legal-layout { grid-template-columns: 1fr; gap: 14px; }
  .legal-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .legal { padding: 22px 20px; }
}
/* report picker */
.rep-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rep-kind { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 13.5px; cursor: pointer; line-height: 1.3; }
.rep-kind:hover { border-color: var(--line-2); }
.rep-kind:has(input:checked) { border-color: var(--accent-text); background: var(--accent-soft); }
.rep-kind input { width: auto; margin: 0; flex: none; }
.rep-kind.urgent { color: var(--danger); }
@media (max-width: 520px) { .rep-kinds { grid-template-columns: 1fr; } }
.notif .link { color: var(--link); }
.notif .n-ic.staff_takedown { color: var(--danger); }
.cat-badge { font-size: 11px; }
.qcard.urgent { border-color: var(--danger); box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 40%, transparent); }
.inbox-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.inbox-item .ii-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inbox-item .ii-msg { white-space: pre-wrap; word-break: break-word; margin: 10px 0 0; font-size: 14px; }
.inbox-item .ii-meta { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.playbook h3 { font-size: 15px; margin: 18px 0 6px; }
.playbook ol, .playbook ul { padding-left: 20px; margin: 4px 0 8px; line-height: 1.6; font-size: 14px; }
footer .f-legal { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 12.5px; gap: 16px; }
footer .f-legal a { color: var(--faint); }
footer .f-legal a:hover { color: var(--text); }

/* recovery codes and two-factor */
.rc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.rc-grid span { font-family: var(--mono); font-size: 16px; letter-spacing: 1px; text-align: center; padding: 4px; }
.rc-count { font-size: 14px; color: var(--muted); }
.rc-count b { font-family: var(--mono); font-size: 22px; color: var(--text); margin-right: 4px; }
.rc-count.low b { color: var(--danger); }
.tfa-key { display: inline-block; margin-top: 6px; font-size: 14px; letter-spacing: 1px; color: var(--text); word-break: break-all; }
.steps { padding-left: 20px; margin: 0 0 6px; }
.acct-cols .span2 { grid-column: span 2; }
#devices .title .ic { margin-right: 6px; vertical-align: -3px; }
@media (max-width: 760px) { .acct-cols .span2 { grid-column: auto; } }

/* file previews */
.preview { padding: 14px; background: var(--panel); display: flex; justify-content: center; }
.img-zoom { display: block; cursor: zoom-in; }
.pdf-frame { width: 100%; height: min(75vh, 900px); border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.audio-box { display: flex; gap: 14px; align-items: center; width: 100%; padding: 6px 4px; }
.audio-box > .ic { width: 38px; height: 38px; padding: 9px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.audio-box audio { width: 100%; margin-top: 8px; }

/* json tree */
.data-view { background: var(--code-bg); }
.jtree { font-family: var(--mono); font-size: 13px; }
.j-bar { display: flex; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.j-body { padding: 10px 14px; max-height: 70vh; overflow: auto; line-height: 1.65; }
.j-kids { padding-left: 18px; border-left: 1px dashed var(--line); margin-left: 5px; }
.j-node > summary { cursor: pointer; list-style: none; border-radius: 4px; }
.j-node > summary::-webkit-details-marker { display: none; }
.j-node > summary::before { content: '+'; display: inline-block; width: 14px; color: var(--faint); }
.j-node[open] > summary::before { content: '-'; }
.j-node > summary:hover { background: var(--panel-2); }
.j-node[open] > summary .j-sum, .j-node[open] > summary .j-close { display: none; }
.j-row { padding-left: 14px; }
.j-key { color: var(--link); }
.j-colon, .j-brace { color: var(--faint); }
.j-sum { color: var(--faint); font-style: italic; margin: 0 6px; font-size: 12px; }
.j-str { color: #7ec699; }
.j-num { color: #f5a742; }
.j-bool, .j-null { color: #c792ea; }
html[data-theme="light"] .j-str { color: #22863a; }
html[data-theme="light"] .j-num { color: #b35900; }
html[data-theme="light"] .j-bool, html[data-theme="light"] .j-null { color: #6f42c1; }

/* csv table */
.csv-meta { font-size: 12.5px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.csv-wrap { overflow: auto; max-height: 70vh; }
table.csv { border-collapse: collapse; font-size: 13px; min-width: 100%; }
table.csv th, table.csv td { padding: 6px 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
table.csv th { position: sticky; top: 0; background: var(--panel-2); font-weight: 600; cursor: pointer; user-select: none; z-index: 1; }
table.csv th:hover { color: var(--accent-text); }
table.csv th.asc::after { content: ' (a-z)'; color: var(--faint); font-weight: 400; font-size: 11px; }
table.csv th.desc::after { content: ' (z-a)'; color: var(--faint); font-weight: 400; font-size: 11px; }
table.csv td.n { text-align: right; font-family: var(--mono); font-size: 12.5px; }
table.csv .rn { color: var(--faint); font-family: var(--mono); font-size: 11.5px; text-align: right; background: var(--panel); cursor: default; }
table.csv tbody tr:hover td { background: var(--panel-2); }
.dv-seg button .ic, .md-seg button .ic { width: 14px; height: 14px; }

/* markdown extras */
.md-toc { float: right; width: min(260px, 40%); margin: 0 0 16px 24px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); font-size: 13.5px; line-height: 1.5; }
.md-toc-head { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 6px; }
.md-toc a { display: block; color: var(--muted); padding: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-toc a:hover { color: var(--text); text-decoration: none; }
.md-toc a.lv1 { padding-left: 12px; }
.md-toc a.lv2 { padding-left: 24px; font-size: 13px; }
.mermaid-box { margin: 14px 0; padding: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow-x: auto; text-align: center; }
.mermaid-box svg { max-width: 100%; height: auto; }
.mermaid-box.bad { color: var(--danger); font-size: 13px; text-align: left; font-family: var(--mono); }
.markdown .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
@media (max-width: 700px) { .md-toc { float: none; width: auto; margin: 0 0 16px; } }

/* comments on a line of code */
.code-scroll { position: relative; }
.lc-add { position: absolute; left: 4px; width: 20px; height: 20px; border-radius: 6px; border: 0; background: var(--accent); color: var(--accent-ink, #0b0d10); display: grid; place-items: center; cursor: pointer; z-index: 2; padding: 0; box-shadow: var(--shadow); }
.lc-add .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.lc-add:hover { transform: scale(1.1); }
tr.lc-row td, tr.lc-form-row td { padding: 6px 16px 8px 64px !important; background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: normal; font-family: var(--sans); }
.lc-box { max-width: 720px; font-size: 13.5px; line-height: 1.5; }
.lc-item { display: flex; gap: 8px; padding: 6px 0; }
.lc-item.reply { padding-left: 30px; }
.lc-item + .lc-item { border-top: 1px dashed var(--line); }
.lc-head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.lc-text { white-space: pre-wrap; word-break: break-word; }
.lc-foot { padding-top: 4px; }
.lc-form textarea { min-height: 64px; font-family: var(--sans); font-size: 14px; }
.line-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-family: var(--mono); color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 1px 9px; margin: 3px 0 2px; }
.line-chip:hover { color: var(--text); text-decoration: none; }
.line-chip .ic { width: 12px; height: 12px; }
tr.flash-row td { animation: rowflash 1.6s ease-out; }
@keyframes rowflash { from { background: var(--accent-soft); } }

/* cover photos */
.tile.has-cover { position: relative; background-color: var(--panel-2); background-position: center; background-size: cover; background-repeat: no-repeat; color: #fff; overflow: hidden; isolation: isolate; }
.tile.has-cover::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .78)); }
.tile.has-cover .cover-gap { flex: 1; }
.tile.has-cover .tile-title { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.tile.has-cover .badge { background: rgba(0, 0, 0, .45); color: #fff; border-color: rgba(255, 255, 255, .28); }
.tile.has-cover .tile-meta, .tile.has-cover .tile-meta .nick { color: rgba(255, 255, 255, .9); }
.tile.has-cover .tile-tags span { background: rgba(0, 0, 0, .45); }
.cover-pick { position: relative; }
.cover-frame { aspect-ratio: 5 / 3; border-radius: var(--radius-sm); border: 1px dashed var(--line-2); background: var(--panel-2) center / cover no-repeat; display: grid; place-items: center; }
.cover-empty { font-family: var(--mono); font-size: 13px; color: var(--faint); }
.cover-tip { position: absolute; left: 0; right: 0; top: calc(100% + 46px); z-index: 20; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); font-size: 13px; line-height: 1.5; opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .12s, transform .12s; }
#cover-field:has(#cover-btn:hover) .cover-tip, #cover-field:has(#cover-btn:focus-visible) .cover-tip, .cover-frame:hover + .cover-tip { opacity: 1; transform: none; }
.draft-state { display: inline-flex; align-items: center; gap: 4px; }
.draft-state .ic { width: 12px; height: 12px; color: var(--accent-text); }
.suggest-mode .editor-side .side-section:not(#suggest-field):not(#submit-field) { display: none; }
.suggest-mode .pkind, .suggest-mode .premove, .suggest-mode .plang { display: none; }
.suggest-mode .pname { pointer-events: none; opacity: .8; }
.suggest-mode #title { opacity: .8; }
.sg-strip { align-items: center; margin-bottom: 14px; }
.sg-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: var(--panel); }
.sg-msg { margin-top: 10px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.sg-part { margin-top: 12px; }
.sg-file { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }

/* status page */
.st-hero { display: flex; gap: 18px; align-items: center; padding: 26px 28px; margin-bottom: 16px; }
.st-hero .st-ic .ic { width: 46px; height: 46px; padding: 10px; border-radius: 50%; }
.st-hero.ok .st-ic .ic { background: color-mix(in srgb, #2ea05a 18%, transparent); color: #2ea05a; }
.st-hero.warn .st-ic .ic { background: var(--warn-soft); color: var(--warn); }
.st-hero.danger .st-ic .ic { background: var(--danger-soft); color: var(--danger); }
.st-hero.info .st-ic .ic { background: color-mix(in srgb, var(--link) 18%, transparent); color: var(--link); }
.st-big { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.st-parts, .st-parts + .card, .st-parts + .card + .card { margin-bottom: 16px; }
.st-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.st-row:first-child { border-top: 0; }
.st-row .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.st-row .dot.good { background: #2ea05a; box-shadow: 0 0 0 4px color-mix(in srgb, #2ea05a 20%, transparent); }
.st-row .dot.bad { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.st-ms { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.st-days { display: grid; grid-template-columns: repeat(90, 1fr); gap: 2px; height: 34px; }
.st-days i { border-radius: 2px; background: #2ea05a; opacity: .85; }
.st-days i:hover { opacity: 1; transform: scaleY(1.12); }
.st-days i.minor { background: var(--warn); }
.st-days i.major { background: var(--danger); }
.st-days i.maintenance { background: var(--link); }
.st-days-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.st-inc { padding: 12px 0; border-top: 1px solid var(--line); }
.st-inc:first-child { border-top: 0; padding-top: 0; }
.st-body { margin-top: 6px; font-size: 14px; white-space: pre-wrap; }
.pdf-view { width: 100%; max-height: min(80vh, 1000px); overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 0; }
.pdf-page { background: #fff; border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); max-width: 100%; height: auto; }
.pdf-meta { font-size: 12.5px; color: var(--muted); align-self: flex-start; }
.md-toc a { text-decoration: none; }
.tile.has-cover .tile-tags span { padding: 1px 6px; border-radius: 6px; }
.suggest-mode #suggest-field { border-top: 0; margin-top: 0; padding-top: 0; }
.acct-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.site-strip.info { background: var(--accent-soft); color: var(--text); border-bottom-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.site-strip.info .ic { color: var(--accent-text); }
.site-strip .btn.small { padding: 2px 8px; margin-left: 6px; }
