:root {
  --bg: #090b0e;
  --bg-2: #10141a;
  --panel: #141a22;
  --line: #243041;
  --text: #eef3f8;
  --muted: #8d9aab;
  --teal: #5eead4;
  --amber: #f5b942;
  --rose: #fb7185;
  --blue: #7dd3fc;
  --violet: #c4b5fd;
  --ok: #34d399;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(1200px 500px at 10% -10%, #12332e 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #2a1d0a 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: Sora, ui-sans-serif, system-ui, sans-serif;
}

.app {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 1.25rem;
  padding: 1.1rem 1.4rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(10px);
}

.brand { display: flex; gap: 0.85rem; align-items: center; min-width: 220px; }
.brand h1 { margin: 0; font-size: 1.15rem; letter-spacing: 0.04em; font-weight: 700; }
.brand p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.78rem; font-weight: 400; }
.logo {
  width: 2.4rem; height: 2.4rem; border-radius: 0.7rem;
  background:
    conic-gradient(from 210deg, var(--teal), var(--amber) 40%, #1b2430 41% 100%);
  box-shadow: inset 0 0 0 3px #0c1210, 0 0 0 1px #2a3a36;
}

.disks { display: flex; flex-wrap: wrap; gap: 0.7rem; flex: 1; justify-content: flex-end; }

.disk {
  --p: 0%;
  appearance: none; border: 1px solid var(--line);
  background: var(--panel);
  color: inherit; text-align: left;
  min-width: 220px; max-width: 320px; flex: 1;
  padding: 0.7rem 0.85rem 0.75rem;
  border-radius: 0.8rem;
  cursor: pointer;
  display: grid; gap: 0.35rem;
}
.disk:hover, .disk.active { border-color: #3d5a53; }
.disk.active { box-shadow: 0 0 0 1px color-mix(in srgb, var(--teal) 50%, transparent); }
.disk .row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.disk .mount { font-weight: 600; font-size: 0.92rem; }
.disk .pct { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.92rem; color: var(--amber); }
.disk .meta { color: var(--muted); font-size: 0.72rem; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.bar {
  height: 7px; border-radius: 99px; background: #1c2530; overflow: hidden;
}
.bar > i {
  display: block; height: 100%; width: var(--p);
  background: linear-gradient(90deg, var(--teal), var(--amber) 70%, var(--rose));
  border-radius: inherit;
}

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.7rem; padding: 0.7rem 1.4rem;
  border-bottom: 1px solid var(--line);
}

.crumbs { display: flex; flex-wrap: wrap; gap: 0.15rem; align-items: center; }
.crumbs button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  font: inherit; cursor: pointer; padding: 0.2rem 0.35rem; border-radius: 0.35rem;
}
.crumbs button:hover { color: var(--text); background: #1b2430; }
.crumbs button.here { color: var(--teal); font-weight: 600; }
.sep { color: #3a4656; padding: 0 0.1rem; }

.tools { display: flex; align-items: center; gap: 0.5rem; }
.status {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem; color: var(--muted);
  min-width: 9rem;
}
.status.busy { color: var(--amber); }
.status.ok { color: var(--ok); }
.status.err { color: var(--rose); }

button.ghost {
  appearance: none; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font: inherit; font-size: 0.8rem;
  padding: 0.35rem 0.7rem; border-radius: 0.5rem; cursor: pointer;
}
button.ghost:hover:not(:disabled) { border-color: #4b6270; }
button.ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  min-height: 0;
  height: calc(100vh - 9.2rem);
}

.map-panel { display: flex; flex-direction: column; min-width: 0; padding: 0.9rem 0.6rem 0.9rem 1.2rem; }
.treemap {
  flex: 1; min-height: 280px; position: relative;
  background: #0c1016;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  overflow: hidden;
}
.treemap svg { width: 100%; height: 100%; display: block; }
.cell { cursor: pointer; }
.cell rect { stroke: #090b0e; stroke-width: 1.5; }
.cell.group > rect { stroke: #07090c; stroke-width: 2; }
.cell:hover rect, .cell.hot rect { stroke: #f8fafc; stroke-width: 2; filter: brightness(1.08); }
.cell text {
  fill: #f8fafc; font-family: Sora, sans-serif; pointer-events: none;
  paint-order: stroke fill; stroke: rgba(0,0,0,.45); stroke-width: 3px;
}
.cell .sz { fill: #dbe4ee; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.hint { color: var(--muted); font-size: 0.75rem; padding: 0.45rem 0.2rem 0; }

.side {
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
  background: color-mix(in srgb, var(--bg-2) 70%, transparent);
}
.side-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.85rem 1rem 0.4rem;
}
.side-head h2 { margin: 0; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); font-size: 0.75rem; font-family: "IBM Plex Mono", ui-monospace, monospace; }

.list { overflow: auto; padding: 0.2rem 0.55rem 1rem; }
.row-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 0.45rem;
  align-items: center;
  width: 100%;
  padding: 0.42rem 0.45rem;
  border: 0; background: transparent; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
  border-radius: 0.5rem;
}
.row-item:hover, .row-item.on { background: #1b2430; }
.dot { width: 10px; height: 10px; border-radius: 2px; }
.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.86rem; }
.szn { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.78rem; color: #c9d4e0; }
.mini {
  grid-column: 2 / -1;
  height: 4px; background: #1c2530; border-radius: 99px; overflow: hidden;
  margin: -0.15rem 0 0.15rem;
}
.mini > i { display: block; height: 100%; background: var(--c, var(--teal)); border-radius: inherit; }

.empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); text-align: center; padding: 1rem;
}
.empty strong { color: var(--text); display: block; margin-bottom: 0.3rem; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; height: auto; }
  .side { border-left: 0; border-top: 1px solid var(--line); max-height: 50vh; }
  .map-panel { padding: 0.8rem; }
  .treemap { height: 50vh; }
}
