/* Material Theme UI "Darker", the default theme: applyThemeCss (js/editor.js) sets these for the chosen theme */
:root {
    --bg: #212121;
    --bg2: #1a1a1a;
    --bg-hover: #2a2a2a;
    --bg-sel-focus: #323232;
    --border: #2b2b2b;
    --fg: #b0bec5;
    --fg-strong: #eeffff;
    --fg-dim: #6e6e6e;
    --fg-faint: #4b4b4b;
    --accent: #ff9800;
    --added: #c3e88d;
    --modified: #80cbc4;
    --deleted: #676767;
    --renamed: #82aaff;
    --icon: #ced0d6;
    --icon-dim: #8c9196;
    --border2: #3c3c3c;
    --bg-on: #3a3a3a;
    --bg-tab: #262626;
    --popup: #2b2b2b;
    --popup-sel: #3d4652;
    --accent-bg: #3d3324;
    --on-accent: #ffffff;
    --sel: #353535;
    --d-mod: #1d2d31;
    --d-mod-w: #12404b;
    --d-ins: #264b33;
    --d-ins-w: #264b33;
    --d-del: #41454b;
    --d-del-w: #41454b;
    --danger: #f07178;
    --ui-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --code-font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --row: 24px;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    background: var(--bg);
    color: var(--fg);
    font: 13px/1.4 var(--ui-font);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--modified); }
code { font-family: var(--code-font); font-size: 0.92em; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.spacer { flex: 1; }
.dim { color: var(--fg-dim); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.ic { display: block; flex-shrink: 0; }

.tb-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0; border: 0; border-radius: 5px;
    background: none; color: var(--icon); cursor: pointer; flex-shrink: 0; text-decoration: none;
}
.tb-btn:hover { background: var(--bg-hover); }
.tb-btn:disabled { opacity: 0.35; cursor: default; background: none; }
.tb-btn.on { background: var(--bg-on); }
.btn {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
    border-radius: 6px; border: 1px solid var(--border2); background: var(--bg-hover); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--bg-on); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 500; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.1); }
.btn-ghost { background: none; border-color: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--bg-hover); }

#app { display: flex; flex-direction: column; height: 100%; height: 100dvh; }
.titlebar {
    display: flex; align-items: center; gap: 10px; height: 40px; flex-shrink: 0;
    padding: 0 8px 0 12px; border-bottom: 1px solid var(--border); background: var(--bg); min-width: 0;
}
.proj { display: flex; align-items: center; gap: 8px; color: var(--fg-strong); text-decoration: none; font-weight: 500; flex-shrink: 0; padding: 4px 6px; border-radius: 5px; }
.proj:hover { background: var(--bg-hover); }
.proj-badge {
    display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px;
    background: #4f6fb5; color: #fff; font-size: 10px; font-weight: 600;
}
.branch { display: flex; align-items: center; gap: 6px; color: var(--fg); flex-shrink: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.branch span { overflow: hidden; text-overflow: ellipsis; }
.tb-title { color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 2; }
.state-pill { font-size: 11px; padding: 1px 8px; border-radius: 10px; flex-shrink: 0; font-weight: 500; }
.state-pill.st-open { background: #1f3d2a; color: #8bd49c; }
.state-pill.st-draft { background: #333; color: #aaa; }
.state-pill.st-merged { background: #33274a; color: #c3a6ff; }
.state-pill.st-closed { background: #4a2626; color: #f59a9a; }

.main { display: flex; flex: 1; min-height: 0; position: relative; }
.strip {
    width: 40px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 6px;
    border-right: 1px solid var(--border);
}
.strip-btn { position: relative; width: 30px; height: 30px; border-radius: 6px; border: 0; background: none; color: var(--icon); display: grid; place-items: center; cursor: pointer; }
.strip-btn:hover { background: var(--bg-hover); }
.strip-btn.active { background: var(--accent-bg); color: var(--accent); }

.side { display: flex; flex-direction: column; min-width: 0; width: 300px; flex-shrink: 0; background: var(--bg); }
body.side-hidden .side, body.side-hidden .splitter { display: none; }
.side-head { display: flex; align-items: center; height: 38px; padding: 0 6px 0 8px; flex-shrink: 0; }
.side-title {
    display: flex; align-items: center; gap: 4px; min-width: 0; border: 0; background: none; cursor: pointer;
    color: var(--fg-strong); font-weight: 500; padding: 4px 6px; border-radius: 5px;
}
.side-title:hover { background: var(--bg-hover); }
.side-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-title.no-menu { cursor: default; }
.side-title.no-menu:hover { background: none; }
.side-title.no-menu .ic { display: none; }
.side-tools { display: flex; align-items: center; gap: 2px; height: 32px; padding: 0 8px; flex-shrink: 0; }
.viewed-count { display: flex; align-items: center; gap: 5px; color: var(--fg-dim); font-size: 12px; white-space: nowrap; }
.splitter { width: 5px; margin: 0 -2px; cursor: col-resize; z-index: 2; flex-shrink: 0; position: relative; }
.splitter::after { content: ""; position: absolute; left: 2px; top: 0; bottom: 0; width: 1px; background: var(--border); }
.splitter:hover::after { background: var(--border2); }

.tree { flex: 1; overflow: auto; padding: 0 6px 12px; overscroll-behavior: contain; }
.tree-msg { padding: 8px 12px; }
.tr {
    display: flex; align-items: center; gap: 5px; height: var(--row); padding-left: calc(var(--d) * 16px + 2px); padding-right: 8px;
    border-radius: 5px; cursor: pointer; white-space: nowrap; user-select: none;
}
.tr:hover { background: var(--bg-hover); }
.tr.sel { background: var(--bg-sel-focus); }
.tw { width: 16px; height: 16px; display: grid; place-items: center; color: var(--icon-dim); flex-shrink: 0; }
.tw .ic { width: 14px; height: 14px; }
.tn { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tr-dir .tn { color: var(--fg-dim); }
.tc { color: var(--fg-dim); margin-left: 4px; }
.tr-file.st-modified .tn, .tr-file.st-changed .tn { color: var(--modified); }
.tr-file.st-added .tn, .tr-file.st-copied .tn { color: var(--added); }
.tr-file.st-removed .tn { color: var(--deleted); text-decoration: line-through; text-decoration-color: var(--fg-faint); }
.tr-file.st-renamed .tn { color: var(--renamed); }
.tr-file.viewed .tn { opacity: 0.55; }
.fi { flex-shrink: 0; display: inline-grid; place-items: center; width: 16px; height: 16px; }
.fi-badge { border-radius: 3px; font: 600 7.5px/1 var(--ui-font); letter-spacing: -0.2px; width: 14px; height: 14px; margin: 1px; }
.fi-text { font: 700 10px/1 var(--code-font); }
.fi-md { font: 700 10px/1 var(--ui-font); color: #6087d7; width: auto; display: inline-flex; letter-spacing: -0.5px; }
.fi-md span { font-size: 9px; }
.fi-folder { color: var(--icon-dim); }

.content { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tabs { display: flex; height: 38px; flex-shrink: 0; border-bottom: 1px solid var(--border); padding-left: 4px; overflow: hidden; }
.tab {
    display: flex; align-items: center; gap: 7px; padding: 0 14px; position: relative; color: var(--fg-dim); white-space: nowrap;
    min-width: 0; border: 0; background: none; cursor: pointer; flex-shrink: 1;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg-strong); background: var(--bg-tab); }
#tab-log { flex-shrink: 0; }
.tab span { overflow: hidden; text-overflow: ellipsis; }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--accent); border-radius: 2px 2px 0 0; }
/* on phones it scrolls rather than widening the page */
.toolbar { display: flex; align-items: center; gap: 4px; height: 38px; padding: 0 8px; flex-shrink: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.toolbar::-webkit-scrollbar { display: none; }
.file-pos { color: var(--accent); white-space: nowrap; padding: 0 2px; font-variant-numeric: tabular-nums; }
.diff-count { color: var(--fg); white-space: nowrap; margin: 0 6px 0 10px; }
.seg { display: flex; gap: 2px; }
.viewed-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; padding: 3px 8px; border: 1px solid var(--border2); border-radius: 6px; user-select: none; }
.viewed-toggle:hover { background: var(--bg-hover); }
.viewed-toggle input { accent-color: var(--accent); margin: 0; width: 14px; height: 14px; }

.viewer { flex: 1; position: relative; min-height: 0; }
.view { position: absolute; inset: 0; display: none; }
.view.active { display: flex; flex-direction: column; }
.view-msg { align-items: center; justify-content: center; }
.msg { text-align: center; padding: 24px; color: var(--fg); font-size: 14px; }
.msg .small { margin-top: 6px; }
.loading-bar { position: absolute; left: 0; top: 0; height: 2px; width: 0; background: var(--accent); opacity: 0; transition: opacity .2s; z-index: 5; }
.loading-bar.on { opacity: 1; animation: load 1.2s ease-in-out infinite; }
@keyframes load { 0% { left: 0; width: 0; } 50% { left: 20%; width: 50%; } 100% { left: 100%; width: 0; } }

.sbs { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sbs-head, .uni-head {
    display: grid; grid-template-columns: minmax(0, 1fr) 80px 30px minmax(0, 1fr); height: 24px; flex-shrink: 0; align-items: center;
    color: var(--fg-dim); font-size: 12.5px; white-space: nowrap;
}
.sbs-head-left { grid-column: 1 / 3; display: flex; align-items: center; gap: 4px; padding-left: 6px; min-width: 0; overflow: hidden; }
.sbs-head-right { grid-column: 3 / 5; display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.sbs-head .sha, .uni-head .sha { color: var(--fg); }
.sbs-head .path, .uni-head .path { overflow: hidden; text-overflow: ellipsis; margin-left: 4px; }
.sbs-head .ic, .uni-head .ic { width: 13px; height: 13px; }
.tag { font-size: 10.5px; padding: 0 6px; border-radius: 8px; }
.tag-add { background: #2a3d22; color: var(--added); }
.sbs-body { display: flex; flex: 1; min-height: 0; border-top: 1px solid var(--border); }
.sbs-ed { flex: 1; min-width: 0; position: relative; }
/* a whole-pixel width: Monaco lays out in whole pixels, and a fractional editor edge leaves a hairline gap in the bands */
.sbs-left { flex: none; width: calc((100% - var(--jd-divw, 0px)) / 2); width: round(down, calc((100% - var(--jd-divw, 0px)) / 2), 1px); }
.sbs-divider { flex-shrink: 0; height: 100%; display: block; background: var(--ed-bg, var(--bg)); touch-action: none; }
.uni-head { display: flex; flex-direction: column; align-items: stretch; height: auto; padding: 2px 8px; gap: 1px; }
.uni-head > span { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; height: 20px; }
.uni-head.aligned { display: grid; grid-template-columns: 1fr 1fr; height: 24px; padding: 0 6px; }
.uni-head .dim { margin-left: 8px; }
.sbs-head .dim { margin-left: 4px; }
.uni-ed { flex: 1; min-height: 0; border-top: 1px solid var(--border); }

.monaco-editor .dl-mod { background: var(--d-mod); }
.monaco-editor .dl-ins { background: var(--d-ins); }
.monaco-editor .dl-del { background: var(--d-del); }
/* word highlights fill the whole line height, as in the IDE (vertical padding on an inline box paints without moving text) */
.monaco-editor .dw-mod, .monaco-editor .dw-ins, .monaco-editor .dw-del { padding: calc((var(--jd-lh, 20px) - 1.32em) / 2) 0; }
.monaco-editor .dw-mod { background: var(--d-mod-w); }
.monaco-editor .dw-ins { background: var(--d-ins-w); }
.monaco-editor .dw-del { background: var(--d-del-w); }
.monaco-editor .dl-pt-ins { --pt: var(--d-ins); }
.monaco-editor .dl-pt-del { --pt: var(--d-del); }
.monaco-editor .dl-pt-mod { --pt: var(--d-mod); }
.monaco-editor .dl-pt-bot { box-shadow: inset 0 -1px 0 var(--pt); }
.monaco-editor .dl-pt-top { box-shadow: inset 0 1px 0 var(--pt); }
.monaco-editor .monaco-scrollable-element > .scrollbar > .slider { border-radius: 6px; }

.img-diff { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; max-height: 100%; overflow: auto; padding: 16px; }
.img-diff figure { margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.img-box {
    min-width: 120px; min-height: 80px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; padding: 8px;
    background: repeating-conic-gradient(var(--bg-hover) 0% 25%, var(--bg2) 0% 50%) 50% / 16px 16px;
}
.img-box img { max-width: min(42vw, 600px); max-height: 60vh; display: block; }

.statusbar { display: flex; align-items: center; gap: 14px; height: 26px; padding: 0 12px; border-top: 1px solid var(--border); color: var(--fg); font-size: 12px; flex-shrink: 0; background: var(--bg2); }
#st-lang { display: flex; align-items: center; gap: 6px; }
.statusbar .add { color: var(--added); }
.statusbar .del { color: var(--danger); }

.menu {
    position: fixed; z-index: 50; min-width: 220px; max-width: min(560px, calc(100vw - 16px)); overflow: auto; padding: 5px;
    background: var(--popup); border: 1px solid var(--border2); border-radius: 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, .5);
}
.menu-item {
    display: flex; align-items: flex-start; gap: 6px; width: 100%; text-align: left; border: 0; background: none; padding: 5px 10px 5px 4px;
    border-radius: 5px; cursor: pointer; color: var(--fg-strong);
}
.menu-item:hover:not(:disabled) { background: var(--popup-sel); }
.menu-item:disabled { color: var(--fg-dim); cursor: default; font-size: 12px; }
.menu-check { width: 16px; flex-shrink: 0; color: var(--accent); padding-top: 1px; }
.menu-label { flex: 1; min-width: 0; }
.menu-hint { color: var(--fg-dim); }
.menu-sub { color: var(--fg-dim); font-size: 11.5px; }
.menu-sep { height: 1px; background: var(--border2); margin: 4px 6px; }
.menu .sha { color: var(--accent); }

dialog { padding: 0; border: 1px solid var(--border2); border-radius: 10px; background: var(--popup); color: var(--fg); max-width: min(520px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
.dlg { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.dlg h2 { margin: 0; font-size: 16px; color: var(--fg-strong); }
.dlg p { margin: 0; }
.dlg input, .land-form input {
    height: 36px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--border2); background: var(--bg2); color: var(--fg-strong);
    font: 13px var(--code-font); outline: none; min-width: 0;
}
.dlg input:focus, .land-form input:focus { border-color: var(--accent); }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; row-gap: 6px; align-items: center; margin-top: 6px; }

#toasts { position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 24px); }
.toast { display: flex; align-items: center; gap: 12px; background: var(--popup); color: var(--fg-strong); padding: 8px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); transition: opacity .4s; }
.toast-error { background: #5a2a2a; }
.toast.out { opacity: 0; }

#landing { height: 100%; overflow: auto; }
.land { max-width: 1160px; margin: 0 auto; padding: 28px 24px 40px; display: flex; flex-direction: column; gap: 14px; min-height: 100%; box-sizing: border-box; }
.land-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.land-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.land h1 { margin: 0; font-size: 22px; color: var(--fg-strong); font-weight: 600; }
.land h3 { margin: 18px 0 2px; font-size: 13px; color: var(--fg-dim); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.land-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: center; padding: max(24px, 6vh) 0 12px; }
.land-main { display: flex; flex-direction: column; gap: 14px; }
.land-pitch { font-size: 30px; line-height: 1.2; font-weight: 600; color: var(--fg-strong); letter-spacing: -.01em; }
.land-shot img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
a.btn { text-decoration: none; }
.land-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.land-examples > .small { flex-basis: 100%; }
.land-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--fg-strong); text-decoration: none; font-size: 12.5px; }
.land-chip span { color: var(--fg-dim); font-size: 11.5px; }
.land-chip:hover { border-color: var(--accent); }
.tok-app { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.tok-app .ic { width: 14px; height: 14px; vertical-align: -2px; color: var(--accent); }
.noscript { max-width: 680px; margin: 0 auto; padding: 48px 24px; }
.noscript a { color: var(--accent); }
.land-lists { max-width: 680px; width: 100%; }
.land-foot { margin-top: auto; padding-top: 28px; }
.land-foot a { color: var(--fg); }
@media (max-width: 900px) {
    .land-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 12px; }
    .land-pitch { font-size: 24px; }
}
@media (max-width: 600px) {
    .land-shot img { width: 62%; margin: 0 auto; border-radius: 18px; }
}
.land p { margin: 0; }
.land-form { display: flex; gap: 8px; }
.land-form input { flex: 1; height: 38px; }
.land-form .btn { height: 38px; }
.land-row { display: flex; gap: 8px; flex-wrap: wrap; }
.land-row .btn { padding-left: 8px; }
.land-error { background: #3a2424; border: 1px solid #5a2f2f; color: #f5b5b5; padding: 10px 12px; border-radius: 8px; }
.land-list { display: flex; flex-direction: column; }
.land-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--fg-strong); }
.land-item:hover { background: var(--bg-hover); }
.li-label { color: var(--modified); font-size: 12px; font-family: var(--code-font); }
.li-title { color: var(--fg); }

.only-mobile { display: none !important; }
@media (max-width: 760px) {
    .only-mobile { display: inline-flex !important; }
    .hide-mobile { display: none !important; }
    :root { --row: 34px; }
    body { font-size: 14px; }
    .titlebar { padding: 0 4px; gap: 6px; height: 44px; padding-top: env(safe-area-inset-top); height: calc(44px + env(safe-area-inset-top)); }
    .proj-name, .state-pill { display: none; }
    .tb-btn { width: 36px; height: 36px; }
    .side {
        position: absolute; z-index: 20; left: 0; top: 0; bottom: 0; width: min(88vw, 380px) !important;
        transform: translateX(-102%); transition: transform .22s ease; box-shadow: 4px 0 24px rgba(0, 0, 0, .5); border-right: 1px solid var(--border);
    }
    body.drawer-open .side { transform: none; }
    .scrim { position: absolute; inset: 0; z-index: 15; background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .22s; display: block !important; }
    body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
    .side-head { height: 44px; }
    .side-tools { height: 40px; }
    .tabs { height: 34px; }
    .tab { padding: 0 10px; }
    .toolbar { height: 44px; gap: 0; padding: 0 4px; padding-bottom: 0; }
    .diff-count, .viewed-toggle span { display: none; }
    .viewed-toggle { padding: 0 6px; margin-right: 2px; }
    .viewed-toggle input { width: 18px; height: 18px; }
    .file-pos { font-size: 13px; }
    .img-box img { max-width: 90vw; }
    .content { padding-bottom: env(safe-area-inset-bottom); }
}

.viewer[data-hl="lines"] .monaco-editor .char-insert, .viewer[data-hl="lines"] .monaco-editor .char-delete,
.viewer[data-hl="none"] .monaco-editor .char-insert, .viewer[data-hl="none"] .monaco-editor .char-delete,
.viewer[data-hl="none"] .monaco-editor .line-insert, .viewer[data-hl="none"] .monaco-editor .line-delete,
.viewer[data-hl="none"] .monaco-editor .gutter-insert, .viewer[data-hl="none"] .monaco-editor .gutter-delete { background: transparent !important; }

.menu-html { color: var(--fg-dim); font-weight: 600; font-size: 12px; padding: 6px 10px 2px 24px; }
.menu-label .ic { margin-right: 4px; }
.btn-small { height: 26px; padding: 0 10px; font-size: 12px; }
.btn-small .ic { width: 14px; height: 14px; }

.log-host { flex: 1; min-height: 0; display: flex; }
.log { display: flex; flex: 1; min-width: 0; min-height: 0; }
.log-main { flex: 1; display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.log-tools, .log-side-tools { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px; flex-shrink: 0; }
.log-search { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 1px solid var(--border2); border-radius: 6px; width: min(320px, 60%); color: var(--fg-dim); }
.log-search:focus-within { border-color: var(--accent); }
.log-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--fg-strong); font: inherit; }
.log-list { flex: 1; overflow: auto; outline: none; overscroll-behavior: contain; }
.lr { display: flex; align-items: center; gap: 12px; height: 28px; padding: 0 12px 0 0; cursor: pointer; white-space: nowrap; user-select: none; }
.lr:hover { background: var(--bg-hover); }
.lr.sel { background: var(--bg-sel-focus); }
.lg { width: 30px; height: 100%; position: relative; flex-shrink: 0; }
.lg-line { position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #3f8f5a; }
.lg-line.first { top: 50%; }
.lg-line.last { bottom: 50%; }
.lg-dot { position: absolute; left: 15px; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #4caf6e; }
.lg-dot.head { background: var(--bg); border: 2px solid #4caf6e; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
.lm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--fg-strong); }
.lref { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-size: 12px; margin-left: 6px; vertical-align: -2px; }
.lref .ic { width: 12px; height: 12px; }
.la { width: 130px; overflow: hidden; text-overflow: ellipsis; color: var(--fg-strong); flex-shrink: 0; }
.ld { width: 150px; color: var(--fg); flex-shrink: 0; }
.log-side { width: 40%; max-width: 560px; min-width: 260px; display: flex; flex-direction: column; min-height: 0; }
.log-tree { flex: 1; min-height: 80px; }
.log-details { flex-shrink: 0; max-height: 45%; overflow: auto; border-top: 1px solid var(--border); padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.log-msg { display: flex; flex-direction: column; gap: 6px; margin: 0 0 4px; white-space: normal; word-break: break-word; font: inherit; color: var(--fg-strong); }
.log-sha { color: var(--accent); font-family: var(--code-font); }

@media (max-width: 760px) {
    .log { flex-direction: column; }
    .log-main { border-right: 0; flex: 1 1 50%; }
    .log-side { width: auto; max-width: none; min-width: 0; flex: 1 1 50%; border-top: 1px solid var(--border); }
    .lr { height: 40px; }
    .la { display: none; }
    .ld { width: auto; font-size: 12px; color: var(--fg-dim); }
}

.side.is-pr .side-head:not(.prs) .side-title { display: none; }
@media (min-width: 761px) { .side.is-pr .side-head:not(.prs) { display: none; } }
.pr-head { padding: 14px 14px 6px 16px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.pr-title { font-size: 17px; line-height: 1.3; font-weight: 600; color: var(--fg-strong); word-break: break-word; }
.pr-title .dim { font-weight: 400; }
.pr-link { color: var(--accent); text-decoration: none; width: fit-content; }
.pr-link:hover { text-decoration: underline; }
.pr-from { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 600; color: var(--fg-strong); min-width: 0; white-space: nowrap; }
.pr-commits, .pr-branch { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-weight: 400; min-width: 0; }
.pr-commits { border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.pr-commits .ic { width: 13px; height: 13px; color: var(--fg); }
.pr-branch { overflow: hidden; }
.pr-branch span { overflow: hidden; text-overflow: ellipsis; }
.pr-branch .ic { width: 14px; height: 14px; }

.tvd { margin-left: auto; width: 22px; height: 18px; display: grid; place-items: center; flex-shrink: 0; cursor: pointer; padding-left: 6px; }
.tvd-dot { width: 7px; height: 7px; border-radius: 50%; background: #4a8fe0; }
.tvd-box { display: none; width: 14px; height: 14px; border: 1px solid var(--fg-faint); border-radius: 3px; place-items: center; color: var(--fg-strong); }
.tvd-box .ic { width: 11px; height: 11px; }
.tr.viewed .tvd-dot, .tr:hover .tvd-dot { display: none; }
.tr.viewed .tvd-box { display: grid; border-color: transparent; color: var(--added); }
.tr:hover .tvd-box { display: grid; border-color: var(--fg-dim); }
@media (hover: none) { .tr .tvd { width: 34px; } }

.menu-search { display: flex; align-items: center; gap: 8px; padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border2); color: var(--fg-dim); position: sticky; top: -5px; background: var(--popup); }
.menu-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--fg-strong); font: inherit; }
.menu-sub code { font-size: 11px; }

.sbs.one-L .sbs-right, .sbs.one-L .sbs-divider, .sbs.one-R .sbs-left, .sbs.one-R .sbs-divider { display: none; }
.sbs.one-L .sbs-head, .sbs.one-R .sbs-head { grid-template-columns: 1fr !important; }
.sbs.one-L .sbs-head-left, .sbs.one-R .sbs-head-left { grid-column: 1; }
.sbs.one-L .sbs-head-right, .sbs.one-R .sbs-head-right { display: none; }

.prl { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.prl-tools { padding: 4px 10px 6px; }
.prl-tools .log-search { width: 100%; }
.prl-filters { display: flex; align-items: center; gap: 6px; padding: 0 10px 6px; }
.prl-state { display: inline-flex; align-items: center; gap: 4px; border: 0; background: var(--bg-on); border-radius: 5px; padding: 3px 8px; cursor: pointer; color: var(--fg-strong); }
.prl-state .ic { width: 12px; height: 12px; }
.prl-list { flex: 1; overflow: auto; padding: 0 6px 12px; }
.prl-item { display: block; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--fg-strong); }
.prl-item:hover { background: var(--bg-hover); }
.prl-item.sel { background: var(--bg-sel-focus); }
.prl-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.prl-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prl-draft { font-size: 10.5px; padding: 0 5px; border-radius: 3px; background: var(--bg-on); color: var(--fg); flex-shrink: 0; }
.prl-com { display: inline-flex; align-items: center; gap: 4px; color: var(--fg); flex-shrink: 0; font-size: 12px; }
.prl-com .ic { width: 14px; height: 14px; }
.prl-meta { color: var(--fg-dim); font-size: 12px; margin-top: 1px; }

.pal { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .35); display: flex; justify-content: center; align-items: flex-start; padding-top: 10vh; }
.pal-box { width: min(720px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column; background: var(--popup); border: 1px solid var(--border2); border-radius: 10px; box-shadow: 0 16px 48px rgba(0, 0, 0, .55); overflow: hidden; }
.pal-tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; }
.pal-tabs button { border: 0; background: none; color: var(--fg); padding: 6px 10px 7px; cursor: pointer; white-space: nowrap; position: relative; border-radius: 5px 5px 0 0; }
.pal-tabs button:hover, .pal-tabs button.on { color: var(--fg-strong); }
.pal-tabs button.on::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.pal-input { padding: 8px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.pal-input input { width: 100%; border: 0; outline: 0; background: none; color: var(--fg-strong); font: 15px var(--ui-font); }
.pal-list { overflow: auto; padding: 4px 6px 6px; overscroll-behavior: contain; }
.pal-group { color: var(--fg-dim); font-size: 11.5px; font-weight: 600; padding: 8px 8px 3px; }
.pal-row { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; border-radius: 5px; cursor: pointer; white-space: nowrap; min-width: 0; }
.pal-row.sel { background: var(--popup-sel); }
.pal-label { color: var(--fg-strong); overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 40px; }
.pal-label b { color: var(--accent); font-weight: 600; }
.pal-row.st-modified .pal-label, .pal-row.st-changed .pal-label { color: var(--modified); }
.pal-row.st-added .pal-label, .pal-row.st-copied .pal-label { color: var(--added); }
.pal-row.st-removed .pal-label { color: var(--deleted); }
.pal-row.st-renamed .pal-label { color: var(--renamed); }
.pal-sub { color: var(--fg-dim); overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; font-size: 12px; }
.pal-hint { margin-left: auto; color: var(--fg-dim); font-size: 12px; flex-shrink: 0; padding-left: 8px; }
.pal-toggle { margin-left: auto; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 8px; background: var(--bg-on); color: var(--fg-dim); flex-shrink: 0; }
.pal-toggle.on { background: var(--accent-bg); color: var(--accent); }
.pal-ai { color: var(--icon-dim); }
.pal-ai .ic { width: 14px; height: 14px; }
.pal-more { color: var(--modified); font-size: 12px; padding: 3px 8px 4px 32px; cursor: pointer; }
.pal-empty { color: var(--fg-dim); padding: 16px; text-align: center; }
.pal-foot { color: var(--fg-dim); font-size: 11.5px; padding: 6px 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
@media (max-width: 760px) {
    .pal { padding-top: calc(8px + env(safe-area-inset-top)); }
    .pal-box { max-height: calc(100dvh - 24px); }
    .pal-row { height: 38px; }
    .pal-foot { display: none; }
    .pal-input input { font-size: 16px; } /* no zoom on focus in iOS */
}

/* full-width multi-line selections (js/editor.js) are line overlays, so they paint under the text */
.monaco-editor .view-overlays .jd-sel, .monaco-editor .margin-view-overlays .jd-sel { background: var(--sel); }

.toast-action { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 2px 4px; }
.strip-badge {
    position: absolute; right: 1px; top: 1px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px;
    background: var(--accent); color: var(--on-accent); font: 600 9px/14px var(--ui-font); font-style: normal; text-align: center;
}
.btn-commit { height: 24px; padding: 0 9px; font-size: 12px; gap: 5px; margin-right: 4px; }
.btn-commit .ic { width: 14px; height: 14px; }
#btn-edit.on { background: var(--accent-bg); color: var(--accent); }
.viewer.editing .sbs-right .monaco-editor .cursors-layer .cursor { background: var(--accent); }
.tr.edited .tn { color: var(--modified); }
.ted { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 6px; flex-shrink: 0; }
.tck { margin-left: 0; padding: 0 6px 0 0; width: 20px; }
@media (hover: none) { .tr .tck { width: 26px; } }
.tck .tvd-box, .tr:hover .tck .tvd-box { display: grid; border-color: var(--fg-dim); }
.tr.viewed .tck .tvd-box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cmt { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cmt-bottom { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px; border-top: 1px solid var(--border); flex: 0 0 auto; height: 44%; min-height: 200px; }
.cmt-opts { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.cmt-amend { display: flex; align-items: center; gap: 7px; cursor: pointer; color: var(--fg); }
.cmt-amend input { accent-color: var(--accent); margin: 0; }
.cmt-count { color: var(--added); font-size: 12px; }
#cmt-msg {
    flex: 1; min-height: 70px; resize: none; padding: 7px 9px; border-radius: 4px; border: 1px solid var(--border2);
    background: var(--ed-bg, var(--bg)); color: var(--fg-strong); font: 12.5px/1.5 var(--code-font); outline: none;
}
#cmt-msg:focus { border-color: var(--accent); }
.cmt-err { color: #ff8a80; font-size: 12px; overflow-wrap: anywhere; }
.cmt-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cmt-actions .btn { height: 28px; font-size: 12.5px; }
.cmt-actions .btn:disabled { opacity: .45; cursor: default; filter: none; }
.cmt-to { display: flex; align-items: center; gap: 4px; font-size: 12px; min-width: 0; overflow: hidden; }
.cmt-to span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmt-to .ic { width: 13px; height: 13px; flex-shrink: 0; }
@media (max-width: 760px) {
    .btn-commit { height: 30px; padding: 0 8px; }
    .cmt-bottom { height: 48%; }
    #cmt-msg { font-size: 16px; } /* no zoom on focus in iOS */
}

.md { color: var(--fg-strong); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md table, .md details, .md .highlight { margin: 0 0 12px; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 22px 0 10px; font-weight: 600; line-height: 1.3; color: var(--fg-strong); }
.md h1 { font-size: 1.75em; padding-bottom: 6px; border-bottom: 1px solid var(--border2); }
.md h2 { font-size: 1.4em; padding-bottom: 5px; border-bottom: 1px solid var(--border2); }
.md h3 { font-size: 1.18em; }
.md h4 { font-size: 1em; }
.md h5, .md h6 { font-size: .9em; color: var(--fg); }
.md a { color: var(--accent); text-decoration: none; }
.md a:hover { text-decoration: underline; }
.md ul, .md ol { padding-left: 2em; }
.md li + li { margin-top: 3px; }
.md li > p { margin: 0 0 6px; }
.md li.task { list-style: none; margin-left: -1.4em; }
.md li.task input { margin: 0 6px 0 0; vertical-align: -1px; accent-color: var(--accent); }
.md code { background: var(--bg-hover); padding: .15em .4em; border-radius: 4px; font-size: .86em; }
.md pre { background: var(--ed-bg, var(--bg2)); border: 1px solid var(--border); padding: 12px 14px; border-radius: 6px; overflow: auto; font: 12.5px/1.5 var(--code-font); }
.md pre code { background: none; padding: 0; font-size: inherit; }
.md pre.shiki { background: var(--ed-bg, var(--bg2)) !important; }
.md blockquote { padding: 0 1em; color: var(--fg); border-left: 3px solid var(--border2); }
.md hr { border: 0; border-top: 1px solid var(--border2); margin: 20px 0; }
.md table { border-collapse: collapse; display: block; overflow: auto; max-width: 100%; }
.md th, .md td { border: 1px solid var(--border2); padding: 5px 12px; }
.md th { font-weight: 600; background: var(--bg-hover); }
.md img { max-width: 100%; border-radius: 4px; }
.md details summary { cursor: pointer; }
.md kbd { border: 1px solid var(--border2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font: .85em var(--code-font); }
.md-compact { font-size: 12.5px; line-height: 1.5; }
.md-compact p, .md-compact ul, .md-compact ol, .md-compact pre { margin-bottom: 6px; }
.md-compact h1, .md-compact h2, .md-compact h3 { font-size: 1.05em; border: 0; margin: 8px 0 4px; padding: 0; }
.log-subject { font-weight: 600; color: var(--fg-strong); font-size: 13px; }
pre.log-body { margin: 0; white-space: pre-wrap; font: 12.5px/1.45 var(--code-font); color: var(--fg); }

.view-md { overflow: hidden; }
.mdp { display: flex; height: 100%; min-height: 0; }
.mdp-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mdp-head { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; font-size: 12px; color: var(--fg-dim); flex-shrink: 0; white-space: nowrap; overflow: hidden; }
.mdp-head .ic { width: 12px; height: 12px; }
.mdp-head .sha { color: var(--fg); }
.mdp-head .path { overflow: hidden; text-overflow: ellipsis; }
.mdp-body { flex: 1; overflow: auto; padding: 14px 28px 40vh; overscroll-behavior: contain; background: var(--ed-bg, var(--bg)); }
.mdp-body .md { max-width: 860px; margin: 0 auto; }
/* changed blocks are a tint only: a bar on the left would read as a quote or a callout */
.md .md-ins, .md .md-mod, .md .md-del { position: relative; border-radius: 3px; box-shadow: -10px 0 0 0 var(--mk-bg), 10px 0 0 0 var(--mk-bg); background: var(--mk-bg); }
.md .md-ins { --mk: var(--added); --mk-bg: var(--d-ins); }
.md .md-mod { --mk: var(--modified); --mk-bg: var(--d-mod); }
.md .md-del { --mk: var(--deleted); --mk-bg: var(--d-del); }
.md li.md-ins, .md li.md-mod, .md li.md-del { box-shadow: none; }
@media (max-width: 760px) { .mdp-body { padding: 12px 18px 40vh; } }

.timeline-host { flex: 1; overflow: auto; min-height: 0; background: var(--ed-bg, var(--bg)); overscroll-behavior: contain; }
.tl { max-width: 900px; margin: 0 auto; padding: 22px 24px 60px; display: flex; flex-direction: column; gap: 14px; }
.tl-loading { padding: 24px; }
.tl-head h1 { margin: 0 0 8px; font-size: 22px; font-weight: 600; line-height: 1.3; color: var(--fg-strong); }
.tl-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--fg); font-size: 13px; }
.tl-sub code { background: var(--accent-bg); color: var(--accent); padding: 1px 6px; border-radius: 4px; }
.tl-card { border: 1px solid var(--border2); border-radius: 8px; overflow: hidden; }
.tl-card > .tl-meta { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 8px 14px; }
.tl-body { padding: 14px 16px; }
.tl-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; color: var(--fg); }
.tl-meta b { color: var(--fg-strong); font-weight: 600; }
.tl-av { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; background: var(--bg-hover); }
.tl-ic { width: 22px; display: grid; place-items: center; color: var(--icon); }
.tl-commits { padding: 2px 0; }
.tl-commits ul { list-style: none; margin: 6px 0 0 29px; padding: 0; border-left: 2px solid var(--border2); }
.tl-commits li { display: flex; align-items: center; gap: 10px; padding: 3px 0 3px 14px; cursor: pointer; font-size: 13px; border-radius: 4px; }
.tl-commits li:hover { background: var(--bg-hover); }
.tl-cmsg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-strong); }
.tl-commits code { color: var(--fg-dim); font-size: 12px; }
.tl-state { font-weight: 500; }
.tl-state.ok { color: var(--added); }
.tl-state.bad { color: var(--deleted); }
.tl-review.ok { border-color: color-mix(in srgb, var(--added) 45%, var(--border2)); }
.tl-review.bad { border-color: color-mix(in srgb, var(--deleted) 45%, var(--border2)); }
.tl-thread { margin: 0 14px 14px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.tl-review > .tl-meta + .tl-thread { margin-top: 14px; }
.tl-path { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; border-bottom: 1px solid var(--border); background: var(--bg2); color: var(--accent); font: 12px var(--code-font); padding: 6px 10px; cursor: pointer; text-align: left; }
.tl-path span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-hunk { margin: 0; padding: 6px 10px; font: 12px/1.5 var(--code-font); overflow: auto; background: var(--ed-bg, var(--bg)); border-bottom: 1px solid var(--border); color: var(--fg); }
.tl-hunk .hk-add, .tl-hunk .hk-del { display: inline-block; min-width: 100%; }
.tl-hunk .hk-add { background: var(--d-ins); }
.tl-hunk .hk-del { background: var(--d-del); }
.tl-reply { padding: 10px 12px; }
.tl-reply + .tl-reply { border-top: 1px solid var(--border); }
.tl-reply .tl-meta { margin-bottom: 6px; }
.tl-reply .md { font-size: 13.5px; }
.tl-end { text-align: center; font-size: 12px; padding-top: 8px; }
.tl-end a { color: var(--accent); }
.pr-links { display: flex; gap: 14px; }
button.pr-link { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
@media (max-width: 760px) { .tl { padding: 16px 14px 60px; } .tl-head h1 { font-size: 19px; } }
.log-trailers { color: var(--fg-dim); font-size: 12px; overflow-wrap: anywhere; }
.log-trailers a { color: var(--accent); }
.md ins.mdw { text-decoration: none; background: var(--d-ins-w); border-radius: 2px; box-shadow: 0 0 0 1px var(--d-ins-w); }
.md del.mdw { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--deleted) 70%, transparent); background: var(--d-del-w); border-radius: 2px; box-shadow: 0 0 0 1px var(--d-del-w); }
.md .md-delblock { position: relative; opacity: .85; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--deleted) 60%, transparent); background: var(--d-del); border-radius: 3px; box-shadow: -10px 0 0 0 var(--d-del), 10px 0 0 0 var(--d-del); margin-bottom: 12px; }
.md .md-delblock > :last-child { margin-bottom: 0; }
.mdp-legend { margin-left: auto; display: flex; align-items: center; gap: 5px; color: var(--fg-dim); font-size: 11.5px; flex-shrink: 0; padding-left: 12px; }
.mdp-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-left: 6px; }
.mdp-legend .lg-ins { background: var(--added); }
.mdp-legend .lg-mod { background: var(--modified); }
.mdp-legend .lg-del { background: var(--deleted); }
@media (max-width: 760px) { .mdp-head { flex-wrap: wrap; height: auto; padding: 4px 12px; row-gap: 2px; } .mdp-legend { margin-left: 0; padding-left: 0; } }
.tree-msg .ic, .menu-label .ic { display: inline-block; vertical-align: -2px; width: 13px; height: 13px; }
.tab-x { display: inline-grid; place-items: center; width: 16px; height: 16px; margin: 0 -4px 0 2px; border-radius: 3px; color: var(--fg-dim); font-style: normal; }
.tab-x .ic { width: 11px; height: 11px; }
.tab-x:hover { background: var(--bg-on); color: var(--fg-strong); }
.pr-clear { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 4px; background: none; color: var(--fg-dim); cursor: pointer; padding: 0; margin-left: -2px; }
.pr-clear .ic { width: 12px; height: 12px; }
.pr-clear:hover { background: var(--bg-hover); color: var(--fg-strong); }
.tb-text { width: auto; padding: 0 7px; gap: 5px; font-size: 12px; color: var(--fg-dim); }
.tb-text .ic { width: 14px; height: 14px; }
.tb-text.on { color: var(--fg-strong); }
.seg-md { margin-right: 4px; }
.md del.mdw + ins.mdw, .md ins.mdw + del.mdw { margin-left: 2px; }
@media (max-width: 760px) { .tb-text span { display: none; } .tb-text { padding: 0 6px; } }
.tip {
    position: fixed; left: 0; top: 0; z-index: 100; max-width: min(420px, calc(100vw - 12px)); pointer-events: none;
    background: var(--popup); color: var(--fg-strong); border: 1px solid var(--border2); border-radius: 5px;
    padding: 4px 8px; font-size: 12px; line-height: 1.4; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); white-space: pre-line;
}
.statusbar .st-group { display: contents; }
.statusbar .st-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statusbar .st-item .ic { width: 13px; height: 13px; }
.mdp-div { flex: none; width: 34px; height: 100%; background: var(--ed-bg, var(--bg)); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.mdp.two .mdp-old .mdp-body { padding-right: 22px; }
.mdp.two .mdp-new .mdp-body { padding-left: 32px; }
.md .md-cur { outline: 1px solid color-mix(in srgb, var(--mk) 55%, transparent); outline-offset: 2px; }
.cmt-who { border: 0; background: none; padding: 0; text-align: left; color: var(--fg-dim); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmt-who b { color: var(--fg); font-weight: 500; }
.cmt-who:hover { color: var(--fg); }
.cmt-gear { margin-left: auto; }
.dlg-label { font-size: 12px; color: var(--fg-dim); margin-bottom: -4px; }
.dlg-row { display: flex; gap: 8px; }
.dlg-row input { flex: 1; min-width: 0; }
.dlg-err { color: #ff8a80; font-size: 12.5px; }
.dlg input[type="checkbox"] { width: auto; padding: 0; margin: 0; }
@media (max-width: 760px) {
    /* the viewer switch is in the diff's gear menu there */
    .toolbar .seg:not(.seg-md) { display: none; }
    .btn-commit span { display: none; }
    .dlg-row { flex-direction: column; }
    .dlg-actions .btn { padding: 0 10px; }
}
.dlg-tools { display: flex; gap: 4px; margin: -4px 0 0 -10px; }

.offline-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; border: 0; background: var(--accent-bg); color: var(--accent); font: 500 11.5px var(--ui-font); cursor: pointer; flex-shrink: 0; margin-right: 4px; }
.offline-pill .ic { width: 12px; height: 12px; }
.dlg-wide { width: auto; }
dialog:has(.dlg-wide) { width: min(560px, calc(100vw - 24px)); max-width: none; }
.dlg p .ic { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; color: var(--added); }
.off-row .btn { flex-shrink: 0; }
.off-list { display: flex; flex-direction: column; gap: 6px; }
.off-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border2); border-radius: 6px; }
.off-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.off-name span { font-size: 12px; }
.off-new { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 6px; background: var(--bg-hover); font-size: 13px; }
.off-new .dlg-row { flex-direction: row; flex-wrap: wrap; }
.off-new .btn .ic { width: 14px; height: 14px; }
.off-progress { display: flex; flex-direction: column; gap: 4px; }
.off-bar { height: 4px; border-radius: 2px; background: var(--bg-on); overflow: hidden; }
.off-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.land h3 .ic { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.land-snap { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px; margin: 18px 0 6px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-bg); }
.land-snap .ic { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; }
.land h3 .dim { font-weight: 400; }
