/* Snapshot Investigator viewer. */
:root {
  --fg: #1f2328;
  --muted: #656d76;
  --border: #d0d7de;
  --bg: #ffffff;
  --accent: #0969da;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
}
body { margin: 0; }
[hidden] { display: none !important; }
header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
header h1 { font-size: 1.1rem; margin: 0; }
main { padding: 1rem 1.25rem; }
h2 { font-size: 1rem; font-weight: 600; margin: 0 0 0.75rem; }
.small { font-size: 11px; }
body.index { background: #eef1f5; min-height: 100vh; }
body.index header { background: var(--bg); }
body.index main { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem 1.1rem 1rem; }
.card h2 { margin-bottom: 0.6rem; }
section.card + section.card { margin-top: 0; }
.card table th:first-child, .card table td:first-child { padding-left: 0; }
.card table th:last-child, .card table td:last-child { padding-right: 0; }
.card tr:last-child td { border-bottom: none; }
.empty { color: var(--muted); font-size: 13px; margin: 0.25rem 0 0; }
.pickers { display: flex; gap: 1rem; flex-wrap: wrap; }
.pickers label { flex: 1 1 16rem; }
.pickers select { width: 100%; min-width: 0; }
.actions { display: flex; align-items: center; gap: 1rem; margin-top: 0.75rem; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.advanced { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.advanced label { display: block !important; }
.advanced label input { min-width: 0 !important; margin: 0 4px; }
.advanced .hint { display: block; margin: 2px 0 0; }
.volume-panel { margin-top: 0.9rem; border-top: 1px solid var(--border); padding-top: 0.7rem; }
.vp-hint { margin: 2px 0 6px; }
.manual-row { margin-top: 0.6rem; }
.manual-row label { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; }
.manual-row input { min-width: 0 !important; }
#chosen code { color: var(--fg); }
#vp-table tr.picked td { background: #eff6ff; }
#vp-table tbody tr { cursor: pointer; }
.vp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vp-tools { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; margin-left: auto; }
.vp-head h3 { font-size: 13px; margin: 0; font-weight: 600; }
.vp-head label { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 4px; color: var(--muted); }
.vp-head input[type=number] { min-width: 0 !important; width: 3.5rem; }
.vp-head .check { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 4px; color: var(--muted); }
.vp-find { margin: 6px 0 8px; } .vp-find summary { cursor: pointer; }
.vp-search { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; flex-wrap: wrap; }
.vp-search input[type=search] { flex: 1 1 24rem; min-width: 16rem; }
.vp-search input[type=number] { min-width: 0; width: 4rem; margin: 0 4px; }
.vp-search label { display: inline-flex !important; flex-direction: row !important; align-items: center; color: var(--muted); }
#vp-job { margin: 4px 0; }
#vp-table td, #vp-table th, .search-results td, .search-results th { padding: 0.25rem 0.5rem; font-size: 12px; }
.vp-scroll { max-height: 24rem; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
#vp-table thead th { position: sticky; top: 0; background: #f6f8fa; z-index: 1; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--fg); }
th.sortable::after { content: " ↕"; color: #c4c8ce; font-size: 10px; }
th.sortable.sorted { color: var(--fg); }
th.sortable.sorted[data-dir="desc"]::after { content: " ↓"; color: var(--accent); }
th.sortable.sorted[data-dir="asc"]::after { content: " ↑"; color: var(--accent); }
#vp-table th:first-child, #vp-table td:first-child { padding-left: 10px; }
.volume-panel button.small, #vp-results button.small { background: var(--bg); color: var(--accent); border: 1px solid var(--border); padding: 2px 10px; font-size: 12px; border-radius: 4px; cursor: pointer; }
.volume-panel button.small:hover, #vp-results button.small:hover { border-color: var(--accent); }
.volume-panel button.small:disabled { color: var(--muted); cursor: default; }
.vp-head { margin-bottom: 4px; }
#vp-table tr.dimrow td { color: var(--muted); }
.flag { display: inline-block; font-size: 10px; padding: 0 5px; border-radius: 8px; background: #e5e7eb; color: #374151; margin-right: 3px; }
.flag.bad { background: #fee2e2; color: #991b1b; }
.flag.fat { background: #ede9fe; color: #5b21b6; }
#vp-results { margin: 6px 0 10px; }
.search-results .match { line-height: 1.5; } .search-results .match code { font-size: 11px; }
tr.history > td { background: #f6f8fa; padding: 4px 10px 8px 24px; }
table.attempts td { font-size: 11px; padding: 2px 8px; border-bottom: none; }
.status.bundle-complete { background: #16a34a; } .status.bundle-truncated { background: #d97706; } .status.bundle-failed { background: #dc2626; } .status.bundle-collecting { background: #2563eb; }
.muted { color: var(--muted); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
table { border-collapse: collapse; width: 100%; }
section + section { margin-top: 1.5rem; }
.collect-form { display: flex; flex-direction: column; }
.collect-form label { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); gap: 2px; }
.collect-form label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 6px; }
.collect-form input, .collect-form select { font-size: 13px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; min-width: 14rem; background: var(--bg); }
.collect-form select:disabled { color: var(--muted); }
.collect-form input[readonly] { background: #f6f8fa; color: var(--muted); }
.collect-form .manual { font-size: 12px; margin-top: 0.75rem; }
.collect-form .manual summary { cursor: pointer; }
.collect-form .manual label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; margin-top: 4px; }
.collect-form .hint { font-size: 11px; margin-left: 8px; }
#picker-issues { margin-top: 0.5rem; }
.collect-form label.check { padding-bottom: 0; }
.collect-form input[type=checkbox] { min-width: 0; }
.collect-form button { font-size: 13px; padding: 5px 14px; border-radius: 4px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.status { display: inline-block; padding: 0 6px; border-radius: 3px; font-size: 11px; font-weight: 600; color: #fff; background: #6b7280; }
.status.running { background: #2563eb; } .status.succeeded { background: #16a34a; } .status.failed { background: #dc2626; } .status.queued { background: #d97706; }
#job-table td { vertical-align: top; }
th, td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-weight: 600; }

/* ---- bundle page (WinDirStat layout) ---- */
body.bundle { height: 100vh; display: flex; flex-direction: column; background: #eef1f5; overflow: hidden; }
body.bundle header { background: var(--bg); flex: 0 0 auto; }
body.bundle header h1 a { color: inherit; text-decoration: none; }
.spacer { flex: 1; }
#signed-in { white-space: nowrap; }
#auth-notice { color: #991b1b; }
.stats { display: flex; gap: 14px; }
.stat { font-size: 11px; color: var(--muted); }
.stat b { display: block; font-size: 14px; color: var(--fg); }
.notes { background: #fff3cd; border-bottom: 1px solid #e6c565; color: #6b5300; padding: 6px 1.25rem; font-size: 12px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 7px 1.25rem; font-size: 12px; border-bottom: 1px solid var(--border); }
.banner.expired { background: #fde8e8; border-color: #f1b0b0; color: #7a1f1f; }
.banner.partial { background: #fff3cd; border-color: #e6c565; color: #6b5300; }
.banner button { margin-left: auto; }
.lf { font-size: 11px; padding: 4px 2px 0; }
.crumb { display: flex; align-items: center; gap: 10px; padding: 4px 10px; font-size: 11px; border-bottom: 1px solid var(--border); background: #fafbfc; flex-wrap: wrap; }
.crumb .path { font-size: 12px; display: inline-flex; align-items: center; flex-wrap: wrap; }
.crumb .path a { color: var(--accent); text-decoration: none; } .crumb .path a:hover { text-decoration: underline; }
.crumb .path a.cur { color: var(--fg); font-weight: 600; }
.crumb .sep { color: var(--muted); margin: 0 4px; }
.crumb .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.export-wrap { position: relative; margin-left: 6px; }
.pop.export-pop { top: 28px; bottom: auto; width: 24rem; z-index: 20; }
.pop.export-pop code { font-size: 11px; }
.export-formats { display: flex; gap: 6px; margin: 4px 0; }
.xmlbox { position: relative; }
.xmlbox .copy { position: absolute; top: 6px; right: 6px; opacity: 0.75; }
.xmlbox .copy:hover { opacity: 1; }
.name.run { color: var(--muted); }
.hatched { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; background: repeating-linear-gradient(45deg, #444 0 2px, #ddd 2px 4px); border-radius: 2px; }
.workspace { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.workspace > .column { flex: 1; }
.column { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.left { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg); flex: 0 0 var(--table-height, 46%); }
.splitter { flex: 0 0 6px; background: #cfd6de; cursor: row-resize; position: relative; }
.splitter:hover, .splitter.active { background: var(--accent); }
.splitter::after { content: ""; position: absolute; left: 50%; top: 2px; width: 40px; height: 2px; margin-left: -20px; background: rgba(255, 255, 255, 0.7); border-radius: 1px; }
body.resizing { cursor: row-resize; user-select: none; }
.tabs { display: flex; gap: 2px; padding: 6px 10px 0; border-bottom: 1px solid var(--border); background: #f6f8fa; align-items: center; }
.tabs button { border: 1px solid var(--border); border-bottom: none; background: #e9edf1; padding: 5px 12px; border-radius: 5px 5px 0 0; cursor: pointer; font-size: 12px; }
.tabs button.active { background: var(--bg); font-weight: 600; position: relative; top: 1px; }
.tabs button:disabled { color: var(--muted); cursor: default; }
.tabs label { font-size: 11px; color: var(--muted); margin-left: 8px; }
.tabs select, .tabs input { font-size: 12px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; margin-left: 6px; }
.subbar { display: none; align-items: center; gap: 6px; padding: 4px 10px; border-bottom: 1px solid var(--border); background: #fafbfc; font-size: 11px; }
.subbar.active { display: flex; }
.subbar .hint { margin-left: auto; }
.scope { padding: 4px 10px; font-size: 11px; border-bottom: 1px solid var(--border); background: #fafbfc; position: sticky; top: 0; z-index: 1; }
.scope a { color: var(--accent); }
.pane { display: none; overflow: auto; flex: 1; min-height: 0; }
.pane.active { display: block; }
.pane.timeline.active { display: flex; flex-direction: column; overflow: hidden; }
.pane.timeline svg { flex: 1; min-height: 0; width: 100%; background: #fff; }
.pane.timeline .band rect { fill: #f3f4f6; cursor: pointer; }
.pane.timeline .band.alt rect { fill: #e5e7eb; }
.pane.timeline .band:hover rect { fill: #dbeafe; }
.pane.timeline .band.dim rect { fill: #fafafa; } .pane.timeline .band.alt.dim rect { fill: #f3f4f6; }
.pane.timeline .band.dim text, .pane.timeline .band-label.dim { fill: #c4c8ce; }
.pane.timeline .key { display: block; color: var(--muted); margin-top: 2px; }
.pane.timeline .band text { font-size: 10px; fill: var(--muted); pointer-events: none; }
.pane.timeline .band-label { font-size: 10px; fill: var(--muted); pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-width: 2.5px; stroke-linejoin: round; }
.pane.timeline .axis { font-size: 10px; color: var(--muted); }
.pane.timeline .axis-label { font-size: 10px; fill: var(--muted); }
.pane.timeline .cum { fill: none; stroke: #334155; stroke-width: 1.2; pointer-events: none; }
.pane.timeline .pt { stroke: #fff; stroke-width: 0.6; cursor: pointer; }
.pane.timeline .lat { cursor: pointer; }
.pane.timeline .pt.dim, .pane.timeline .lat.dim { opacity: 0.15; }
.pane.timeline .pt.hot { r: 6; stroke: #111; stroke-width: 1.5; opacity: 1; }
.pane.timeline .lat.hot { stroke: #111; stroke-width: 1.5; opacity: 1; }
body.bundle th { position: sticky; top: 0; background: #f6f8fa; white-space: nowrap; }
body.bundle td { white-space: nowrap; padding: 2px 8px; border-bottom: 1px solid #f0f2f5; }
#events, #raw { table-layout: fixed; }
#events td, #raw td { overflow: hidden; text-overflow: ellipsis; }
#events th:nth-child(1), #raw th:nth-child(1) { width: 6.5rem; }
#events th:nth-child(2), #raw th:nth-child(2) { width: 7.5rem; }
#events th:nth-child(3) { width: 3.5rem; }
#events th:nth-child(6) { width: 5rem; }
#events th:nth-child(7) { width: 12rem; }
#raw th:nth-child(5), #raw th:nth-child(6) { width: 12rem; }
#tree { table-layout: auto; }
#tree td:first-child { max-width: 28rem; overflow: hidden; text-overflow: ellipsis; }
#tree .bar { width: 110px; }
td.num, th.num { text-align: right; }
tr.row { cursor: pointer; }
tr.row:hover td { background: #f3f6fa; }
tr.row.sel td { background: #dbeafe; }
tr.row.hover td { background: #fef3c7; }
.tabs .small { font-size: 11px; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg); cursor: pointer; margin-left: 4px; }
.name { display: inline-flex; align-items: center; gap: 4px; }
.name .tog { width: 16px; height: 16px; line-height: 16px; text-align: center; color: var(--muted); font-size: 10px; display: inline-block; border-radius: 3px; }
.name .tog.has { cursor: pointer; color: var(--fg); }
.name .tog.has:hover { background: #e5e9ee; }
.name .ic { width: 12px; height: 10px; display: inline-block; border-radius: 2px; background: #cbd5e1; }
.name.touched .ic { background: #06b6d4; }
.name.context { color: var(--muted); }
.bar { height: 11px; width: 140px; background: #e5e9ee; border-radius: 2px; display: flex; overflow: hidden; }
.bar i { display: block; height: 100%; }
.badge { display: inline-block; padding: 0 5px; border-radius: 3px; font-size: 10px; font-weight: 600; color: #fff; margin-right: 2px; line-height: 15px; background: #6b7280; }
.op-create { background: #16a34a; } .op-delete { background: #dc2626; } .op-deleteoverwrite { background: #ea580c; }
.op-moveto { background: #7c3aed; } .op-movefrom { background: #a78bfa; } .op-rename { background: #d97706; }
.op-updatemeta { background: #0891b2; } .op-updatefiledata { background: #2563eb; } .op-link { background: #0f766e; }
.right { border-left: 1px solid var(--border); background: var(--bg); display: flex; flex-direction: row; min-height: 0; overflow: hidden; flex: 0 0 18px; width: 18px; }
.right.open { flex-basis: var(--side-width, 456px); width: var(--side-width, 456px); }
.vsplit { flex: 0 0 5px; cursor: col-resize; background: #e5e9ee; }
.vsplit:hover, .vsplit.active { background: var(--accent); }
body.resizing-x { cursor: col-resize; user-select: none; }
.side-toggle { flex: 0 0 18px; border: none; border-right: 1px solid var(--border); background: #f6f8fa; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0; position: relative; }
.side-toggle::after { content: "Details"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); transform-origin: center; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; margin-top: 18px; }
.right.open .side-toggle::after { content: none; }
.side-head { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: #f6f8fa; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.side-head b { color: var(--fg); letter-spacing: 0; text-transform: none; font-size: 12px; }
.side-toggle:hover { background: #e9edf1; color: var(--fg); }
.side-body { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.right:not(.open) .side-body { visibility: hidden; }
.legend { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 12px; }
.legend .lh { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.legend.inline { padding: 0; border: none; margin-bottom: 6px; }
.detail details { margin: 4px 0 8px; }
.detail summary { cursor: pointer; color: var(--accent); font-size: 12px; }
table.lt { width: 100%; border-collapse: collapse; font-size: 12px; }
table.lt th { position: static; background: none; color: var(--muted); font-weight: 500; font-size: 11px; padding: 0 6px 3px 0; border-bottom: 1px solid var(--border); }
table.lt td { padding: 2px 6px 2px 0; border-bottom: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.lt td:first-child, table.lt th:first-child { width: 14px; padding-right: 4px; }
table.lt td.num, table.lt th.num { text-align: right; }
table.lt i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; vertical-align: middle; }
.legend tr.lr { cursor: pointer; }
.legend tr.lr:hover td, .legend tr.lr.sel td { background: #f1f5f9; }
.detail { flex: 1; overflow: auto; padding: 8px 10px; font-size: 12px; }
.detail pre { max-height: none; }
.detail h3 { margin: 0 0 6px; font-size: 13px; }
.detail h3 ~ h3 { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 2px 8px; margin-bottom: 8px; word-break: break-all; }
.kv span:nth-child(odd) { color: var(--muted); }
.detail pre { background: #0f172a; color: #e2e8f0; padding: 8px; border-radius: 5px; font: 11px/1.4 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-all; max-height: 60vh; overflow: auto; }
.detail pre mark { background: #fde047; color: #111; }
.detail a { color: var(--accent); }
.map { flex: 1; min-height: 60px; position: relative; background: #111; }
.map svg { display: block; width: 100%; height: 100%; }
.cell rect { stroke: #111; stroke-width: 0.6; cursor: pointer; }
.cell.dim rect { opacity: 0.18; }
.cell rect:hover, .cell.hot rect { stroke: #fff; stroke-width: 2; }
.cell.hot rect { stroke: #fde047; stroke-width: 3; opacity: 1 !important; }
.cell rect.hatch { stroke: none; }
.detail .hl { display: flex; align-items: center; gap: 5px; font-size: 12px; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail .hl:hover { background: #fef3c7; border-radius: 3px; }
.detail .hl .ord { color: var(--muted); font-size: 10px; min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.detail .hl .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.detail .hl code { color: var(--muted); }
.detail .hl.not_read, .detail .hl.not_stored { opacity: 0.6; }
.detail .st { font-size: 10px; padding: 0 5px; border-radius: 8px; background: #e5e7eb; color: #374151; }
.detail .st.needed { background: #ffedd5; color: #9a3412; } .detail .st.scanned { background: #fef3c7; color: #78350f; }
.detail .st.not-read { background: #f3f4f6; color: #6b7280; } .detail .st.not-stored { background: #fee2e2; color: #991b1b; }
.detail .hsec { display: flex; justify-content: flex-end; margin: 10px 0 -6px; }
.detail .sorts { font-size: 11px; color: var(--muted); display: inline-flex; gap: 3px; align-items: center; }
.detail .sorts button.on { background: var(--fg); color: #fff; border-color: var(--fg); }
.detail details { margin: 4px 0; } .detail summary { cursor: pointer; font-size: 12px; }
.grp rect { fill: none; stroke: #fff; stroke-opacity: 0.55; stroke-width: 1.2; pointer-events: none; }
.grp.sel rect { stroke: #fde047; stroke-opacity: 1; stroke-width: 2.5; }
.grp.sel text { fill: #fde047; }
#pane-tree:focus { outline: none; }
#pane-tree:focus-visible tr.row.sel td { box-shadow: inset 0 0 0 1px var(--accent); }
.grp text { fill: #fff; font-size: 10px; paint-order: stroke; stroke: #000; stroke-width: 2px; pointer-events: none; }
.mapbar { position: absolute; right: 8px; bottom: 6px; color: #ddd; font-size: 11px; background: rgba(0, 0, 0, 0.55); padding: 3px 4px 3px 8px; border-radius: 4px; display: flex; align-items: center; gap: 6px; }
.gear { background: none; border: none; color: #ddd; font-size: 13px; cursor: pointer; padding: 0 4px; border-radius: 3px; line-height: 1; }
.gear:hover { background: rgba(255, 255, 255, 0.15); }
.pop { position: absolute; right: 0; bottom: 26px; width: 300px; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); padding: 10px 12px; font-size: 12px; text-align: left; }
.pop-title { font-weight: 600; margin-bottom: 6px; }
.pop label { display: block; padding: 3px 0; cursor: pointer; }
.pop label input { margin-right: 6px; }
.pop-note { margin-top: 8px; font-size: 11px; }
