@font-face { font-family: "Instrument Serif"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  --paper: #111213; --window: #171719; --ink: #ececec; --graphite: #a6a6ab; --mute: #76767c;
  --line: #36363c; --chrome: #26262a; --chrome-2: #3a3a40; --hair: #27272c; --wash: #1d1d20;
  --gold: #d9ab2f; --gold-d: #4a3d1c; --gold-bar: #5c4a12; --gold-text: #e8c25e; --on-gold: #1a1500;
  --blue: #4f7fd8; --cut: #7fa7ee; --cut-d: #1f4468;
  --blue-t: #27272b; --blue-t2: #4a3d1c; --blue-mid: #d9ab2f; --blue-text: #e8c25e;
  --red: #ee6a5b; --red-t: #3b1d1b; --green: #4fcf97; --green-t: #12301f; --ochre: #7fa7ee; --ochre-t: #1f4468;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
.page { max-width: 1200px; margin: 0 auto; padding: 36px 20px 64px; }

/* masthead */
.masthead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
h1 { margin: 0; font: 400 clamp(46px, 8.2vw, 104px)/.92 var(--serif); letter-spacing: -.02em; }
.sub { margin: 14px 0 0; font: 500 clamp(17px, 2vw, 21px)/1.25 var(--sans); color: var(--graphite); }
.intro { max-width: none; color: var(--graphite); margin: 18px 0 30px; font-size: 15.5px; line-height: 1.6; }
.intro b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; flex: none; background: var(--window); }
.lang button { background: transparent; border: 0; padding: 4px 11px; cursor: pointer; color: var(--graphite); font-weight: 500; }
.lang button + button { border-left: 1px solid var(--line); }
.lang button.on { background: var(--gold); color: var(--on-gold); }

/* window */
.window { background: var(--window); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); }
.titlebar { display: flex; justify-content: center; align-items: center; height: 30px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden;
  background: repeating-linear-gradient(to bottom, var(--window) 0 1px, var(--chrome-2) 1px 2px); }
.titlebar > * { background: var(--chrome); height: 20px; display: flex; align-items: center; font-size: 12.5px; }
.titlebar .ico { padding: 0 0 0 10px; width: auto; background: var(--chrome); }
.titlebar .ico::before { position: relative; }
.titlebar b { padding: 0 6px 0 8px; font-weight: 600; }
.titlebar .path { padding: 0 12px 0 0; color: var(--graphite); overflow: hidden; text-overflow: ellipsis; display: block; line-height: 20px; }

.ico { display: inline-block; width: 16px; height: 13px; flex: none; position: relative; }
.ico-folder { background: var(--blue-mid); border-radius: 2px; height: 11px; }
.ico-folder::before { content: ""; position: absolute; left: 0; top: -3px; width: 7px; height: 4px; background: var(--blue-mid); border-radius: 2px 2px 0 0; }
.ico-file { width: 11px; height: 14px; border: 1.5px solid var(--mute); border-radius: 2px; }
.ico-file::after { content: ""; position: absolute; left: 2px; right: 2px; top: 4px; height: 1.5px; background: var(--mute); box-shadow: 0 3px 0 var(--mute); }
.ico-lock { width: 11px; height: 12px; background: var(--mute); border-radius: 2px; margin-top: 3px; }
.ico-lock::before { content: ""; position: absolute; left: 2px; top: -5px; width: 7px; height: 6px; border: 1.5px solid var(--mute); border-bottom: 0; border-radius: 4px 4px 0 0; }
.ico-drive { width: 22px; height: 12px; border: 1.5px solid var(--line); border-radius: 3px; }
.ico-drive::after { content: ""; position: absolute; right: 3px; bottom: 2px; width: 3px; height: 3px; border-radius: 50%; background: var(--green); }
.ico-bin { width: 13px; height: 14px; border: 1.5px solid var(--graphite); border-top-width: 3px; border-radius: 1px 1px 3px 3px; }
.ico-info { width: 14px; height: 14px; border: 1.5px solid var(--graphite); border-radius: 50%; }

/* disk */
.disk { padding: 22px 24px 20px; border-bottom: 1px solid var(--line); }
.disk-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.drive { display: flex; gap: 12px; align-items: center; }
.drive-name { font: 400 26px/1.1 var(--serif); letter-spacing: -.005em; }
.drive-sub { color: var(--graphite); font-size: 12.5px; }
.badge { padding: 5px 12px; border-radius: 3px; font-weight: 600; font-size: 13px; border: 1px solid; }
.badge.over { background: var(--red-t); color: var(--red); border-color: var(--red); }
.badge.ok { background: var(--green-t); color: var(--green); border-color: var(--green); }

.bar { position: relative; height: 28px; margin: 18px 0 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 2px; display: flex; overflow: visible; }
.seg { height: 100%; transition: width .35s ease; flex: none; }
.seg.spend { background: var(--blue); }
.seg.borrow { background: repeating-linear-gradient(135deg, var(--red) 0 4px, #e5877b 4px 8px); }
.seg.free { background: repeating-linear-gradient(135deg, var(--green) 0 4px, #7cc2a1 4px 8px); }
.cap { position: absolute; top: -7px; bottom: -7px; width: 2px; background: var(--ink); transition: left .35s ease; }
.cap::before { content: ""; position: absolute; top: -1px; left: -4px; border: 5px solid transparent; border-top: 6px solid var(--ink); border-bottom: 0; }
.legend { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--graphite); }
.legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend .dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line); }
.legend-l span { margin-right: 20px; white-space: nowrap; }
.gapline { margin-top: 8px; font-size: 13px; color: var(--graphite); min-height: 18px; }
.gapline b { color: var(--ink); }
.good { color: var(--green) !important; } .bad { color: var(--red) !important; }

.chal { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; font-size: 13px; }
.chal label { color: var(--graphite); font-weight: 500; }
.chal select, .search { background: var(--wash); color: var(--ink); border: 1px solid var(--line); border-radius: 3px; padding: 5px 9px; font-size: 13px; max-width: 100%; }
.chal-stat { color: var(--graphite); font-weight: 500; }
.chal-stat.good { font-weight: 600; }

.rec { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--hair); }
.rec-title { font: 400 19px/1.2 var(--serif); margin-bottom: 8px; }
.rbar { display: flex; height: 12px; margin-bottom: 8px; gap: 2px; }
.rbar div { height: 100%; }
.rec .legend span { margin-right: 20px; white-space: nowrap; }

.bridge { margin-top: 18px; border-top: 1px solid var(--hair); padding-top: 14px; }
.bridge summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; width: fit-content; }
.bridge table { width: 100%; max-width: 780px; border-collapse: collapse; margin-top: 12px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.bridge td { padding: 4px 0; border-bottom: 1px solid var(--hair); }
.bridge td:last-child { text-align: right; white-space: nowrap; padding-left: 16px; font-family: var(--mono); font-size: 12.5px; }
.bridge tr.tot td { font-weight: 600; padding-top: 9px; border-bottom-color: var(--chrome-2); }
.bridge tr.subr td { color: var(--graphite); font-size: 12.5px; }
.bridge tr.big td { font: 400 22px/1.3 var(--serif); color: var(--green); border-bottom: 0; padding-top: 12px; }
.bridge tr.big td:last-child { font-family: var(--serif); font-size: 22px; }
.bridge p { color: var(--graphite); font-size: 12.5px; max-width: 780px; margin: 10px 0 0; }

/* toolbar */
.toolbar { display: flex; align-items: center; gap: 6px; padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--wash); flex-wrap: wrap; }
.tb-label { color: var(--graphite); font-size: 13px; margin-left: 10px; }
.tb-hint { margin-left: auto; color: var(--graphite); font-size: 12.5px; }
.btn { background: var(--chrome); border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 1px 0 var(--line); padding: 3px 11px; cursor: pointer; font-size: 13px; font-weight: 500; line-height: 1.45; }
.btn:hover { background: var(--chrome-2); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.ghost { color: var(--ink); background: transparent; }
.btn.primary { background: var(--gold); color: var(--on-gold); border-color: var(--gold); box-shadow: 0 1px 0 #7a5f12; }
.btn.primary:hover { background: #e8bd45; }
.btn.small { padding: 1px 9px; font-size: 12px; margin-left: auto; }
.btn[disabled] { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn:focus-visible, .tree:focus-visible, .x:focus-visible, .lang button:focus-visible, .chal select:focus-visible, .search:focus-visible, .bridge summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.search { margin-left: 10px; width: 200px; }

/* files */
.cols { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 560px; }
.files { border-right: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; }
.files-head { display: flex; gap: 14px; padding: 6px 16px; font-size: 12.5px; color: var(--graphite); border-bottom: 1px solid var(--chrome-2); background: var(--wash); }
.files-head span:first-child { width: 138px; }
.files-head .hy { margin-left: auto; width: 56px; text-align: right; flex: none; }
.tree { overflow: auto; max-height: 700px; flex: 1; padding: 4px 0 8px; outline: none; }
.row { display: flex; align-items: center; gap: 6px; padding: 0 12px 0 6px; height: 34px; font-size: 14px; cursor: default; position: relative; user-select: none; }
.row:hover { background: var(--wash); }
.row.sel { background: var(--gold-d); box-shadow: inset 3px 0 0 var(--gold); }
.row.drop { outline: 1px dashed var(--gold); }
.row .tog { width: 26px; height: 26px; flex: none; border: 0; background: transparent; color: var(--graphite); cursor: pointer; padding: 0; border-radius: 4px; position: relative; }
.row .tog::before { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translate(-65%, -50%) rotate(-45deg); transition: transform .15s; }
.row .tog.open::before { transform: translate(-50%, -70%) rotate(45deg); }
.row .tog:hover { background: var(--chrome); color: var(--ink); }
.row.sel .tog { color: var(--ink); } .row.sel .tog:hover { background: rgba(255, 255, 255, .14); }
.row .tog.empty { visibility: hidden; }
.row .sizecell { width: 108px; flex: none; position: relative; height: 24px; overflow: hidden; }
.row .sizebar { position: absolute; inset: 0 auto 0 0; background: rgb(217 171 47 / var(--a, .5)); transition: width .3s ease; }
.row .sizetxt { position: relative; padding: 0 7px; font: 500 12.5px/24px var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.folder .name { font-weight: 600; }
.row.changed .sizebar { background: rgb(127 167 238 / var(--a, .5)); }
.row.up .sizebar { background: rgb(79 207 151 / var(--a, .5)); }
.row.locked .sizebar { background: rgb(130 130 136 / var(--a, .5)); }
.row.locked .name { color: var(--graphite); }
.row.deleted .name, .row.deleted .sizetxt { text-decoration: line-through; color: var(--mute); }
.row.deleted .sizebar { width: 0 !important; }
.row.sel .sizebar { background: rgb(232 194 94 / var(--a, .5)); }
.row.sel .sizetxt, .row.sel .name { color: var(--ink); }
.row .act { display: none; gap: 3px; flex: none; }
.row:hover .act, .row.sel .act { display: flex; }
.act button { background: var(--chrome); border: 1px solid var(--line); border-radius: 3px; color: var(--ink); cursor: pointer; font-size: 12px; padding: 0 7px; height: 22px; line-height: 1; }
.act button:hover { background: var(--chrome-2); }
.act .del { color: var(--red); }
.pct { font: 500 11.5px var(--mono); color: var(--cut); flex: none; }
.pct.upc { color: var(--green); }
.row .yoy { width: 56px; text-align: right; flex: none; font: 400 12px var(--mono); color: var(--graphite); font-variant-numeric: tabular-nums; }
.row .yoy.u { color: var(--red); }

.tree mark { background: #7a6420; color: var(--ink); border-radius: 2px; }
.nohits { padding: 22px 16px; color: var(--graphite); }

/* side */
.side { display: flex; flex-direction: column; min-width: 0; }
.bin { border-bottom: 1px solid var(--line); }
.bin.drop { background: var(--red-t); outline: 1px dashed var(--red); outline-offset: -3px; }
.bin-head, .props-head { display: flex; align-items: center; gap: 8px; padding: 7px 16px; font-weight: 600; background: var(--chrome); border-bottom: 1px solid var(--chrome-2); }
.props-head { border-top: 0; border-bottom: 1px solid var(--line); }
.bin-body { padding: 8px 16px 12px; max-height: 150px; overflow: auto; color: var(--graphite); font-size: 13px; }
.bin-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--hair); }
.bin-item:first-child { border-top: 0; }
.bin-item .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); cursor: pointer; }
.bin-item .v { font: 500 12px var(--mono); }
.bin-item button { background: transparent; border: 0; color: var(--blue-text); cursor: pointer; font-size: 12.5px; padding: 0 2px; text-decoration: underline; text-underline-offset: 2px; }
.props-body { padding: 16px 16px 18px; border-bottom: 1px solid var(--line); }
.p-kicker { font-size: 12.5px; color: var(--graphite); }
.p-name { font-size: 13px; font-weight: 500; margin: 2px 0 0; overflow-wrap: anywhere; color: var(--graphite); font-family: var(--mono); }
.p-big { font: 400 54px/1.05 var(--serif); letter-spacing: -.015em; margin: 8px 0 4px; font-variant-numeric: lining-nums; }
.p-sub { color: var(--graphite); font-size: 13px; line-height: 1.55; }
.p-desc { margin: 12px 0 0; padding-left: 12px; border-left: 2px solid var(--blue-mid); color: var(--ink); font-size: 14px; line-height: 1.55; }
.p-slider { margin: 16px 0 4px; display: flex; align-items: center; gap: 12px; }
.p-slider label { font-weight: 500; }
.p-slider input[type=range] { flex: 1; accent-color: var(--gold); }
.p-slider .val { font: 500 13px var(--mono); min-width: 52px; text-align: right; }
.p-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.p-comp { margin-top: 16px; display: grid; gap: 3px; }
.p-comp .c { display: grid; grid-template-columns: 1fr auto; font-size: 12.5px; gap: 10px; color: var(--graphite); position: relative; padding: 3px 7px; overflow: hidden; }
.p-comp .c i { position: absolute; inset: 0 auto 0 0; background: rgba(217, 171, 47, .16); }
.p-comp .c span { position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-comp .c span:last-child { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.lockmsg { color: var(--graphite); font-size: 13px; margin-top: 10px; }

.map-wrap { padding: 14px 16px 16px; flex: 1; }
.crumb { font-size: 12.5px; color: var(--graphite); display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; font-family: var(--mono); }
.crumb button { background: var(--chrome); color: var(--ink); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; padding: 0 8px; }
.map { position: relative; height: 300px; background: var(--wash); border: 1px solid var(--line); overflow: hidden; }
.tile { position: absolute; border: 1px solid var(--window); padding: 6px 7px; overflow: hidden; cursor: pointer; font-size: 12px; line-height: 1.25; background: var(--gold-d); color: var(--ink); transition: left .3s, top .3s, width .3s, height .3s, background .2s; }
.tile:hover { filter: brightness(1.18); }
.tile.sel { outline: 2px solid var(--ink); outline-offset: -3px; z-index: 2; }
.tile b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tile span { font: 400 11.5px var(--mono); opacity: .85; }
.tile.t-orig { background: var(--gold-d); }
.tile.t-down { background: var(--cut-d); }
.tile.t-up { background: #1b4a35; }
.tile.t-lock { background: repeating-linear-gradient(135deg, var(--chrome) 0 5px, var(--wash) 5px 10px); color: var(--graphite); }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--graphite); }
.map-legend i { display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line); }
.mapempty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--graphite); font-size: 13px; text-align: center; padding: 12px; }

.statusbar { display: flex; align-items: center; gap: 14px; padding: 7px 16px; background: var(--wash); color: var(--graphite); font: 400 12px var(--mono); flex-wrap: wrap; }
.statusbar .spacer { flex: 1; }

/* notes */
.notes { margin-top: 56px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 48px; max-width: 1060px; }
.notes h2 { font: 400 25px/1.15 var(--serif); margin: 0 0 8px; letter-spacing: -.005em; }
.notes p { margin: 0; color: #c3c8d2; font-size: 14.5px; line-height: 1.62; max-width: 62ch; }

dialog { background: var(--window); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 0; max-width: min(580px, calc(100vw - 32px)); width: 100%; box-shadow: 0 40px 80px -30px rgba(19, 22, 27, .6); }
dialog::backdrop { background: rgba(5, 7, 10, .7); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, var(--window) 0 1px, var(--chrome-2) 1px 2px); }
.dlg-head b { background: var(--chrome); padding: 0 8px; font-weight: 600; }
.x { background: var(--chrome); border: 0; color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 8px; }
.dlg-body { padding: 18px 20px; font-size: 14.5px; display: grid; gap: 12px; }
.dlg-body ol { margin: 0; padding-left: 20px; display: grid; gap: 7px; }
.dlg-body p { margin: 0; color: var(--graphite); line-height: 1.55; }
.dlg-foot { padding: 12px 20px 16px; display: flex; justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 3px; opacity: 0; pointer-events: none; transition: .25s; font-size: 13.5px; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .page { padding: 24px 14px 48px; }
  .cols { grid-template-columns: 1fr; }
  .files { border-right: 0; border-bottom: 1px solid var(--line); }
  .tree { max-height: 440px; }
  .tb-hint { display: none; }
  .row .yoy, .files-head .hy { display: none; }
  .search { margin-left: 0; flex: 1; min-width: 120px; }
  .row .act { display: flex; }
  .row .sizecell { width: 92px; }
  .files-head span:first-child { width: 92px; }
  .map { height: 260px; }
  .p-big { font-size: 44px; }
  .notes { grid-template-columns: 1fr; gap: 26px; }
  .disk { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
