/* Windows Task Manager */
.app-taskmgr .tm-root { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 7px 6px 6px; }
.app-taskmgr .tm-tabs { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.app-taskmgr .tm-tabs .tab-strip { flex: none; overflow: hidden; }
.app-taskmgr .tm-tabs .tab-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 9px 9px; }
.app-taskmgr .tm-tabs .tab-panel[hidden] { display: none; }
.app-taskmgr .tm-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }

/* list view */
.app-taskmgr .tm-table { flex: 1; min-height: 60px; overflow: auto; background: #fff; border: 1px solid var(--xp-border-blue); outline: none; position: relative; }
.app-taskmgr .tm-row { display: grid; grid-template-columns: var(--tm-cols); min-width: min-content; }
.app-taskmgr .tm-head { position: sticky; top: 0; z-index: 1; background: #EBEADB; height: 19px; box-shadow: 0 1px 0 #D6D2C2, 0 2px 0 #E2DECD; }
.app-taskmgr .tm-th { padding: 0 6px; line-height: 18px; border-right: 1px solid #D6D2C2; box-shadow: inset -1px 0 #fff; cursor: var(--cur-arrow); user-select: none; }
.app-taskmgr .tm-th:hover { background: #F9F8F3; box-shadow: inset 0 -3px #F9B119; }
.app-taskmgr .tm-th.sorted { background: #F3F3EE; }
.app-taskmgr .tm-cell { padding: 0 6px; line-height: 16px; height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; min-width: 0; }
.app-taskmgr .tm-cell > span { overflow: hidden; text-overflow: ellipsis; }
.app-taskmgr .tm-cell.num { justify-content: flex-end; }
.app-taskmgr .tm-th.num { text-align: right; }
.app-taskmgr .tm-body .tm-row.sel { background: var(--xp-hilite); color: #fff; }
.app-taskmgr .tm-table:not(:focus) .tm-body .tm-row.sel { background: #ECE9D8; color: #000; }
.app-taskmgr .tm-cell svg { flex: none; }
.app-taskmgr .tm-apps[data-view="large"] .tm-head { display: none; }
.app-taskmgr .tm-apps[data-view="large"] .tm-body { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 6px; }
.app-taskmgr .tm-apps[data-view="large"] .tm-row { display: block; width: 86px; }
.app-taskmgr .tm-apps[data-view="large"] .tm-row .tm-cell:first-child { flex-direction: column; height: auto; white-space: normal; text-align: center; line-height: 13px; }
.app-taskmgr .tm-apps[data-view="large"] .tm-row .tm-cell:first-child svg { width: 32px; height: 32px; }
.app-taskmgr .tm-apps[data-view="large"] .tm-row .tm-cell:not(:first-child),
.app-taskmgr .tm-apps[data-view="small"] .tm-head { display: none; }
.app-taskmgr .tm-apps[data-view="small"] .tm-row { grid-template-columns: 1fr; }
.app-taskmgr .tm-apps[data-view="small"] .tm-row .tm-cell:not(:first-child) { display: none; }

.app-taskmgr .tm-btnrow { flex: none; display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.app-taskmgr .tm-btnrow.spread { justify-content: space-between; align-items: center; }

/* performance */
.app-taskmgr .tm-grp { margin: 0; padding: 2px 6px 6px; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.app-taskmgr .tm-perf { gap: 4px; }
.app-taskmgr .tm-perf-graphs { flex: 1; min-height: 150px; display: grid; grid-template-columns: 80px minmax(0, 1fr); grid-template-rows: 1fr 1fr; gap: 4px 8px; }
.app-taskmgr .tm-canvas { flex: 1; width: 100%; min-width: 0; min-height: 40px; display: block; background: #000; border: 1px solid; border-color: #ACA899 #fff #fff #ACA899; }
.app-taskmgr .tm-perf-nums { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.app-taskmgr .tm-kv { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; line-height: 14px; }
.app-taskmgr .tm-kv .v { text-align: right; }

/* networking */
.app-taskmgr .tm-net .tm-grp { flex: 1; }
.app-taskmgr .tm-net-graph { flex: 1; display: flex; gap: 4px; min-height: 80px; }
.app-taskmgr .tm-grp > .tm-canvas { height: 0; flex: 1 1 0; }
.app-taskmgr .tm-net-graph .tm-canvas { width: 0; height: auto; }
.app-taskmgr .tm-scale { flex: none; display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: 10px; padding: 0 2px; }
.app-taskmgr .tm-scale[hidden] { display: none; }
.app-taskmgr .tm-net .tm-table { flex: none; height: 76px; }

/* tiny footprint mode (double-click the graphs) */
.app-taskmgr.tm-tiny .menubar, .app-taskmgr.tm-tiny .tab-strip, .app-taskmgr.tm-tiny .xp-statusbar,
.app-taskmgr.tm-tiny .tm-perf-nums { display: none; }
.app-taskmgr.tm-tiny .tm-root { padding: 0; }
.app-taskmgr.tm-tiny .tm-tabs .tab-panel { border: 0; padding: 2px; top: 0; box-shadow: none; }

/* dialogs */
.tm-newtask { width: 330px; max-width: 100%; }
.tm-newtask .tm-nt-top, .tm-shutdown .tm-sd-top { display: flex; gap: 12px; margin-bottom: 12px; line-height: 14px; }
.tm-cols { width: 260px; max-width: 100%; line-height: 14px; }
.tm-cols-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; padding: 6px; background: #fff; border: 1px solid var(--xp-border-blue); }
.tm-sendmsg { display: flex; flex-direction: column; gap: 4px; width: 300px; max-width: 100%; }
.app-taskmgr-sd .tm-shutdown { padding: 12px; line-height: 14px; display: flex; flex-direction: column; gap: 6px; }
.app-taskmgr-sd .tm-sd-msg { background: #fff; padding: 6px; min-height: 48px; }

@media (max-width: 420px) {
  .app-taskmgr .tm-perf-graphs { grid-template-columns: 64px minmax(0, 1fr); }
  .app-taskmgr .tm-perf-nums { grid-template-columns: 1fr; }
  .app-taskmgr .tm-perf-nums .tm-kv { grid-template-columns: repeat(3, auto 1fr); }
  .app-taskmgr .tm-tabs .tab { padding: 0 4px; }
  .app-taskmgr .tm-tabs .tab.active { padding: 0 5px; }
}

/* explorer.exe killed from Task Manager: no taskbar, no desktop icons (fallback when the shell has no hook). */
body.explorer-dead #taskbar, body.explorer-dead #desktop-icons, body.explorer-dead #startmenu-root { visibility: hidden; }
